xuqiang 4 年 前
コミット
06414bb4dd

+ 0 - 1
src/main/pc-space/src/components/TransactionPhone.vue

@@ -77,7 +77,6 @@ export default {
                 })
                 .then(() => {
                     this.$message.success('设置成功');
-                    console.log(222);
                     setTimeout(() => {
                         this.$router.push('/transactionsuccess');
                     }, 1000);

+ 2 - 0
src/main/pc-space/src/main.js

@@ -6,6 +6,7 @@ import http from './plugins/http';
 import ElementUI from 'element-ui';
 import './styles/element/index.css';
 import common from './mixins/common';
+import phone from './mixins/phone';
 // ElementUI.Dialog.props.closeOnClickModal.default = false;
 import SingleUpload from '@/components/SingleUpload';
 import CropUpload from '@/components/CropUpload';
@@ -21,6 +22,7 @@ Vue.prototype.$colors = {
 Vue.use(ElementUI);
 Vue.use(http);
 Vue.mixin(common);
+Vue.mixin(phone);
 Vue.component('single-upload', SingleUpload);
 Vue.component('crop-upload', CropUpload);
 Vue.prototype.$EventBus = eventBus;

+ 2 - 2
src/main/pc-space/src/plugins/http.js

@@ -4,9 +4,9 @@ import qs from 'qs';
 let baseUrl = 'http://localhost:8080';
 switch (process.env.NODE_ENV) {
     case 'development':
-        baseUrl = 'https://nfttest.9space.vip/';
+        // baseUrl = 'https://nfttest.9space.vip/';
         // baseUrl = 'http://192.168.50.190:8080';
-        // baseUrl = 'http://localhost:8080';
+        baseUrl = 'http://localhost:8080';
         // baseUrl = 'http://192.168.50.190:8080';
         break;
     case 'test':

+ 1 - 1
src/main/pc-space/src/views/user/AccountData.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="container">
         <el-upload class="top" :action="uploadUrl" :show-file-list="false" :before-upload="beforeAvatarUpload2">
-            <img v-if="userInfo.bg" class="top" :src="userInfo.bg" alt="" />
+            <img v-if="userInfo.bg" class="top" :src="userInfo.bg || ''" alt="" />
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
         </el-upload>
         <div class="top1">

+ 11 - 7
src/main/pc-space/src/views/user/Modifypad.vue

@@ -43,19 +43,19 @@
                             </el-input>
                         </el-form-item>
                     </el-form-item>
-                    <el-form-item label="原密码" prop="password">
+                    <!-- <el-form-item label="原密码" prop="password">
                         <el-input
                             style="width: 300px"
                             type="password"
                             v-model="ruleForm.password"
                             placeholder="请输入原密码"
                         ></el-input>
-                    </el-form-item>
-                    <el-form-item label="新密码" prop="pass">
+                    </el-form-item> -->
+                    <el-form-item label="新密码" prop="password">
                         <el-input
                             style="width: 300px"
                             type="password"
-                            v-model="ruleForm.pass"
+                            v-model="ruleForm.password"
                             placeholder="请输入新密码,8-16位字母数字组合"
                             autocomplete="off"
                         ></el-input>
@@ -89,7 +89,7 @@ export default {
         return {
             labelPosition: 'right',
             ruleForm: {
-                pass: '',
+                // pass: '',
                 password: '',
                 phone: ''
             },
@@ -98,7 +98,7 @@ export default {
                 checkPass: [
                     {
                         validator: (rule, value, callback) => {
-                            if (value !== this.ruleForm.pass) {
+                            if (value !== this.ruleForm.password) {
                                 callback(new Error('两次密码输入不一致'));
                             } else {
                                 callback();
@@ -123,9 +123,13 @@ export default {
             this.sendMsg(this.form.phone);
         },
         codeSend() {
+            // ?password=${this.ruleForm.password}&code=${this.ruleForm.code}
             this.$refs.form.validate(valid => {
                 this.$http
-                    .post(`/user/changePassword?password=${this.ruleForm.password}&code=${this.ruleForm.code}`)
+                    .post('/user/changePassword', {
+                        password: this.ruleForm.password,
+                        code: this.ruleForm.code
+                    })
                     .then(res => {
                         this.$toast.success('修改成功');
                         setTimeout(() => {

+ 7 - 3
src/main/pc-space/src/views/user/Security.vue

@@ -50,13 +50,16 @@
 
 <script>
 import SecurityPhone from '../../components/SecurityPhone.vue';
+// import phone from '../../mixins/phone';
 import { mapState } from 'vuex';
 export default {
+    // mixins: [phone],
     components: { SecurityPhone },
     data() {
         return {
             flag: true,
             labelPosition: 'right',
+            token: '',
             ruleForm: {
                 phone: '',
                 code: ''
@@ -73,16 +76,17 @@ export default {
     },
     methods: {
         send() {
-            this.sendMsg(this.ruleForm.phone);
+            this.sendMsg(this.userInfo.phone);
         },
         codeSend() {
             this.$http
                 .get('/sms/verify', {
-                    phone: this.ruleForm.phone,
+                    phone: this.userInfo.phone,
                     code: this.ruleForm.code
                 })
-                .then(() => {
+                .then(res => {
                     this.ruleForm.code = '';
+                    this.token = res;
                     this.flag = false;
                 })
                 .catch(e => {

+ 4 - 2
src/main/pc-space/src/views/user/Transaction.vue

@@ -42,7 +42,7 @@
                 </div>
             </div>
             <div v-else>
-                <transaction-phone :code="ruleForm.code" @Jump="Jump"></transaction-phone>
+                <transaction-phone :code="token" @Jump="Jump"></transaction-phone>
             </div>
         </div>
     </div>
@@ -58,6 +58,7 @@ export default {
     data() {
         return {
             flag: true,
+            token: '',
             labelPosition: 'right',
             ruleForm: {
                 phone: '',
@@ -83,7 +84,8 @@ export default {
                     phone: this.userInfo.phone,
                     code: this.ruleForm.code
                 })
-                .then(() => {
+                .then(res => {
+                    this.token = res;
                     this.flag = false;
                 })
                 .catch(e => {