|
|
@@ -82,7 +82,7 @@
|
|
|
<script>
|
|
|
import eventBus from '../../eventBus';
|
|
|
import phone from '../../mixins/phone';
|
|
|
-import { mapState } from 'vuex';
|
|
|
+import { mapState, mapMutations } from 'vuex';
|
|
|
export default {
|
|
|
mixins: [phone],
|
|
|
data() {
|
|
|
@@ -118,6 +118,7 @@ export default {
|
|
|
this.ruleForm.phone = this.userInfo.phone;
|
|
|
},
|
|
|
methods: {
|
|
|
+ ...mapMutations(['updateUserInfo']),
|
|
|
// 验证码
|
|
|
send() {
|
|
|
this.sendMsg(this.form.phone);
|
|
|
@@ -131,14 +132,16 @@ export default {
|
|
|
code: this.ruleForm.code
|
|
|
})
|
|
|
.then(res => {
|
|
|
- this.$toast.success('修改成功');
|
|
|
+ this.$message.success('修改成功');
|
|
|
setTimeout(() => {
|
|
|
- this.$router.back();
|
|
|
- }, 1500);
|
|
|
+ localStorage.removeItem('webToken');
|
|
|
+ this.updateUserInfo(null);
|
|
|
+ this.$router.push('/');
|
|
|
+ }, 1000);
|
|
|
})
|
|
|
.catch(e => {
|
|
|
if (e) {
|
|
|
- this.$toast(e.error);
|
|
|
+ this.$message(e.error);
|
|
|
}
|
|
|
});
|
|
|
});
|