xuqiang 4 лет назад
Родитель
Сommit
8866fe249e

+ 7 - 9
src/main/pc-space/src/components/RegisterInfo.vue

@@ -160,18 +160,16 @@ export default {
             this.verifyMsg(this.form.phone, this.form.code)
                 .then(() => {
                     this.$http
-                        .post('/auth/forgotPassword', {
-                            phone: this.form.phone,
-                            password: this.form.password,
-                            code: this.form.code
-                        })
-                        .then(() => {
-                            this.$toast.success('修改成功');
-                            this.$emit('init');
+                        .post(`/user/changePassword?password=${this.form.password}&code=${this.form.code}`)
+                        .then(res => {
+                            this.$message.success('修改成功');
+                            // setTimeout(() => {
+                            //     this.$router.back();
+                            // }, 1500);
                         })
                         .catch(e => {
                             if (e) {
-                                this.$message.error(e.error);
+                                this.$message(e.error);
                             }
                         });
                 })

+ 1 - 1
src/main/pc-space/src/main.js

@@ -6,7 +6,7 @@ import http from './plugins/http';
 import ElementUI from 'element-ui';
 import './styles/element/index.css';
 import common from './mixins/common';
-ElementUI.Dialog.props.closeOnClickModal.default = false;
+// ElementUI.Dialog.props.closeOnClickModal.default = false;
 import SingleUpload from '@/components/SingleUpload';
 import CropUpload from '@/components/CropUpload';
 import './styles/font.less';

+ 32 - 19
src/main/pc-space/src/views/user/Modifypad.vue

@@ -81,25 +81,38 @@ export default {
     methods: {
         codeSend() {
             this.$refs.form.validate(valid => {
-                if (valid) {
-                    this.$http
-                        .post('/user/changePw', {
-                            newPassword: this.ruleForm.pass,
-                            password: this.ruleForm.password
-                        })
-                        .then(() => {
-                            this.$message.warning('修改成功,请重新登录');
-                            localStorage.removeItem('webToken');
-                            this.$store.commit('updateUserInfo', null);
-                        })
-                        .then(() => {
-                            this.$router.push('/');
-                            eventBus.$emit('login');
-                        })
-                        .catch(e => {
-                            this.$message.error(e.error);
-                        });
-                }
+                this.$http
+                    .post(`/user/changePassword?password=${this.ruleForm.password}&code=${this.ruleForm.code}`)
+                    .then(res => {
+                        this.$toast.success('修改成功');
+                        setTimeout(() => {
+                            this.$router.back();
+                        }, 1500);
+                    })
+                    .catch(e => {
+                        if (e) {
+                            this.$toast(e.error);
+                        }
+                    });
+                // if (valid) {
+                //     this.$http
+                //         .post('/user/changePw', {
+                //             newPassword: this.ruleForm.pass,
+                //             password: this.ruleForm.password
+                //         })
+                //         .then(() => {
+                //             this.$message.warning('修改成功,请重新登录');
+                //             localStorage.removeItem('webToken');
+                //             this.$store.commit('updateUserInfo', null);
+                //         })
+                //         .then(() => {
+                //             this.$router.push('/');
+                //             eventBus.$emit('login');
+                //         })
+                //         .catch(e => {
+                //             this.$message.error(e.error);
+                //         });
+                // }
             });
         }
     }