zhangjie 1 سال پیش
والد
کامیت
0f75aaf201
1فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 7 1
      src/modules/login/views/LoginAuthen.vue

+ 7 - 1
src/modules/login/views/LoginAuthen.vue

@@ -41,7 +41,13 @@ export default {
       if (!data) return;
 
       if (data.orgInfo) this.$ls.set("orgId", data.orgInfo.id);
-      if (data.schoolInfo) this.$ls.set("schoolId", data.schoolInfo.id);
+      if (data.schoolInfo && data.schoolInfo.length) {
+        const curSchool = data.schoolInfo[0];
+        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);
 
       // 强制修改密码