|
@@ -47,11 +47,20 @@ export default {
|
|
|
methods: {
|
|
|
...mapActions(['login', 'update']),
|
|
|
async handleSave({ data }) {
|
|
|
- let res = await this.update({ id: this.user.id, ...data });
|
|
|
+ const info = JSON.parse(JSON.stringify(data));
|
|
|
+ let res = await this.update({ id: this.user.id, ...info });
|
|
|
if (this.$checkRes(res)) {
|
|
|
- res = await this.login(data);
|
|
|
- if (!_.isBoolean(res)) this.$message.warning(res.errmsg);
|
|
|
- else this.$router.push({ path: '/' });
|
|
|
+ res = await this.login({ user: info, router: this.$router, needReturn: true, needNotice: false });
|
|
|
+ if (res.errcode !== 0) this.$message.warning(res.errmsg);
|
|
|
+ else {
|
|
|
+ this.$router.push({ path: '/' });
|
|
|
+ Notification({
|
|
|
+ title: '学校用户信息',
|
|
|
+ message: `修改成功`,
|
|
|
+ type: 'success',
|
|
|
+ duration: 2000,
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
},
|