lrf402788946 5 vuotta sitten
vanhempi
commit
337fc2ec70
1 muutettua tiedostoa jossa 13 lisäystä ja 4 poistoa
  1. 13 4
      src/views/info/index.vue

+ 13 - 4
src/views/info/index.vue

@@ -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,
+          });
+        }
       }
     },
   },