lrf402788946 преди 5 години
родител
ревизия
a6b7b34280
променени са 1 файла, в които са добавени 9 реда и са изтрити 9 реда
  1. 9 9
      src/layout/login.vue

+ 9 - 9
src/layout/login.vue

@@ -28,18 +28,18 @@ export default {
       }
       let wxtoken = sessionStorage.getItem('wxtoken');
       if (!wxtoken) {
-        // window.location.href = `/wxtoken/auth?test=13089419810&redirect_uri=${window.location.href}`; //学生:省外=>teststud1;省内=>lrf402788946:openid:ocPqjswkUejZHq2ANriNrFFC7A3I  企业:13089419810,testcorp1
+        // window.location.href = `/wxtoken/auth?test=ocPqjszoXHv-5QDlpPEW-1-_ZiZ4&redirect_uri=${window.location.href}`; //学生:省外=>teststud1;省内=>lrf402788946:openid:ocPqjswkUejZHq2ANriNrFFC7A3I  企业:13089419810,testcorp1
       } else {
-        let type = sessionStorage.getItem('type');
         let result;
-        if (type === 'corp') {
+        result = await this.studLogin({ type: `1`, data: { wxtoken: wxtoken } });
+        if (`${result.errcode}` !== 0) {
           result = await this.corpLogin({ type: `1`, data: { wxtoken: wxtoken } });
-        } else {
-          result = await this.studLogin({ type: `1`, data: { wxtoken: wxtoken } });
-        }
-        if (`${result.errcode}` !== '0') {
-          this.setUser('none');
-          return;
+          if (`${result.errcode}` !== 0) {
+            if (`${result.errcode}` !== '0') {
+              this.setUser('none');
+              return;
+            }
+          }
         }
         sessionStorage.setItem('token', result.data);
         let info = jwt.decode(result.data);