guanchunjie 3 years ago
parent
commit
74bb138330
3 changed files with 19 additions and 10 deletions
  1. 4 1
      src/components/login/LoginNav.vue
  2. 6 8
      src/components/login/login.vue
  3. 9 1
      src/views/login/index.vue

+ 4 - 1
src/components/login/LoginNav.vue

@@ -277,7 +277,10 @@ export default {
     }
     _this.getLangList();
   },
-  mounted() {},
+  mounted() {
+    this.projectName =
+      this.projectList.length > 0 ? this.projectList[0].name : "";
+  },
 };
 </script>
 

+ 6 - 8
src/components/login/login.vue

@@ -257,14 +257,12 @@ export default {
             localStorage.setItem("user_name", JSON.stringify(obj));
           }
           setToken(res);
-          if (res.user_type == "TEACHER") {
-            res.popedom_code_list.forEach((item, i) => {
-              if (item == 2000001) {
-                location.href = `/GCLS-Learn/#/EnterSys`;
-                return;
-              }
-            });
-          } else if (res.user_type == "STUDENT") {
+
+          if (
+            res.popedom_code_list.indexOf(2000001) > -1 ||
+            res.user_type == "STUDENT"
+          ) {
+            this.$message.warning("跳转中....");
             location.href = `/GCLS-Learn/#/EnterSys`;
           }
         })

+ 9 - 1
src/views/login/index.vue

@@ -380,12 +380,20 @@ export default {
             this.LoginOrRegistration = "login";
             removeToken();
           } else {
-            if (userInfor.popedom_code_list.indexOf(2000001) > -1) {
+            this.userMessage = userInfor;
+            if (
+              userInfor.popedom_code_list.indexOf(2000001) > -1 ||
+              userInfor.user_type == "STUDENT"
+            ) {
               this.isPc = false;
+              this.$message.warning("跳转中....");
               location.href = `/GCLS-Learn/#/EnterSys`;
             } else {
               this.isPc = true;
               this.LoginOrRegistration = "";
+              this.projectList = this.handleProList(
+                userInfor.popedom_code_list
+              );
             }
             this.getLangList();
             updateWordPack({