guanchunjie пре 3 година
родитељ
комит
46b8d7bfaa
1 измењених фајлова са 28 додато и 38 уклоњено
  1. 28 38
      src/views/login/index.vue

+ 28 - 38
src/views/login/index.vue

@@ -368,26 +368,37 @@ export default {
         user_code = userInfor.user_code;
         user_type = userInfor.user_type;
         session_id = userInfor.session_id;
-      }
-      let MethodName = "login_control-Is_Effective_User";
-      getAcsCode(MethodName, {
-        UserCode: user_code,
-        SessionID: session_id,
-        UserType: user_type,
-      }).then((res) => {
-        if (res.is_effective == "false") {
-          this.userMessage = null;
-        } else {
-          let userMessage = getToken();
-          if (userMessage) {
-            userMessage = JSON.parse(userMessage);
-            this.changeLoginReg("", userMessage);
+        let MethodName = "login_control-Is_Effective_User";
+        getAcsCode(MethodName, {
+          UserCode: user_code,
+          SessionID: session_id,
+          UserType: user_type,
+        }).then((res) => {
+          if (res.is_effective == "false") {
+            this.userMessage = null;
+            this.isPc = true;
+            this.LoginOrRegistration = "login";
+            removeToken();
+          } else {
+            if (userInfor.popedom_code_list.indexOf(2000001) > -1) {
+              this.isPc = false;
+              location.href = `/GCLS-Learn/#/EnterSys`;
+            } else {
+              this.isPc = true;
+              this.LoginOrRegistration = "";
+            }
+            this.getLangList();
+            updateWordPack({
+              word_key_list: ["teaching", "teaching"],
+            });
           }
-        }
-      });
+        });
+      } else {
+        this.isPc = true;
+        this.LoginOrRegistration = "login";
+      }
     },
     handleProList(list) {
-      console.log(list);
       let projectList = [];
       if (list.length == 0) {
         let arr = [
@@ -554,32 +565,11 @@ export default {
             this.loginType = "student";
           }
         }
-        this.getLangList();
         this.Islogin();
-        updateWordPack({
-          word_key_list: ["teaching", "teaching"],
-        });
         let type = this.$route.query.type;
         if (type && type == "login") {
           this.LoginOrRegistration = "login";
         }
-        let userInfor = getToken();
-        let user_code = "",
-          user_type = "",
-          session_id = "";
-        if (userInfor) {
-          userInfor = JSON.parse(getToken());
-          user_code = userInfor.user_code;
-          user_type = userInfor.user_type;
-          session_id = userInfor.session_id;
-        }
-        if (!session_id || !user_code || !user_type || !userInfor) {
-          this.isPc = true;
-          this.LoginOrRegistration = "login";
-        } else {
-          this.isPc = false;
-          location.href = `/GCLS-Learn/#/EnterSys`;
-        }
       }
     },
   },