|
|
@@ -36,7 +36,7 @@
|
|
|
<el-input style="width: 300px" v-model="ruleForm.code" placeholder="请输入短信验证码">
|
|
|
<span
|
|
|
@click="send"
|
|
|
- style="color: #ff4f50; cursor: pointer; font-size: 13px"
|
|
|
+ style="color: #fdfb60; cursor: pointer; font-size: 13px"
|
|
|
slot="suffix"
|
|
|
>{{ time === 0 ? '发送验证码' : `重新发送${time}s` }}</span
|
|
|
>
|
|
|
@@ -89,7 +89,6 @@ export default {
|
|
|
return {
|
|
|
labelPosition: 'right',
|
|
|
ruleForm: {
|
|
|
- // pass: '',
|
|
|
password: '',
|
|
|
phone: ''
|
|
|
},
|
|
|
@@ -121,29 +120,30 @@ export default {
|
|
|
...mapMutations(['updateUserInfo']),
|
|
|
// 验证码
|
|
|
send() {
|
|
|
- this.sendMsg(this.form.phone);
|
|
|
+ this.sendMsg(this.userInfo.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
|
|
|
- })
|
|
|
- .then(res => {
|
|
|
- this.$message.success('修改成功');
|
|
|
- setTimeout(() => {
|
|
|
- localStorage.removeItem('webToken');
|
|
|
- this.updateUserInfo(null);
|
|
|
- this.$router.push('/');
|
|
|
- }, 1000);
|
|
|
- })
|
|
|
- .catch(e => {
|
|
|
- if (e) {
|
|
|
- this.$message(e.error);
|
|
|
- }
|
|
|
- });
|
|
|
+ if (valid) {
|
|
|
+ this.$http
|
|
|
+ .post('/user/changePassword', {
|
|
|
+ password: this.ruleForm.password,
|
|
|
+ code: this.ruleForm.code
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.$message.success('修改成功');
|
|
|
+ setTimeout(() => {
|
|
|
+ localStorage.removeItem('webToken');
|
|
|
+ this.updateUserInfo(null);
|
|
|
+ this.$router.push('/');
|
|
|
+ }, 1000);
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ if (e) {
|
|
|
+ this.$message(e.error);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
}
|