瀏覽代碼

登录调整

zhangjie 1 年之前
父節點
當前提交
92f509deb1
共有 1 個文件被更改,包括 10 次插入2 次删除
  1. 10 2
      src/modules/login/views/Login.vue

+ 10 - 2
src/modules/login/views/Login.vue

@@ -184,8 +184,16 @@ export default {
 
       if (data.orgInfo)
         this.$ls.set("orgId", data.orgInfo.id, this.GLOBAL.authTimeout);
-      if (data.schoolInfo)
-        this.$ls.set("schoolId", data.schoolInfo.id, this.GLOBAL.authTimeout);
+
+      if (data.schoolInfo && data.schoolInfo.length) {
+        const curSchool = data.schoolInfo.find(
+          item => item.code === this.loginModel.schoolCode
+        );
+        if (curSchool) {
+          this.$ls.set("schoolId", curSchool.id, this.GLOBAL.authTimeout);
+          this.$ls.set("schoolName", curSchool.name, this.GLOBAL.authTimeout);
+        }
+      }
       this.$ls.set("user", data, this.GLOBAL.authTimeout);
 
       // 强制修改密码