seimin 2 anni fa
parent
commit
49410f9a05
1 ha cambiato i file con 7 aggiunte e 17 eliminazioni
  1. 7 17
      src/views/Login.vue

+ 7 - 17
src/views/Login.vue

@@ -123,20 +123,10 @@ export default {
123
     zlogin() {
123
     zlogin() {
124
       console.log(this);
124
       console.log(this);
125
       var that = this;
125
       var that = this;
126
-      var ssoStr = "";
127
-      var ssoJson;
128
-      if (this.isSSo) {
129
-        ssoStr = location.search
130
-          .replace("?", "")
131
-          .split("&")[0]
132
-          .split("=")[1];
133
-        ssoStr = decode(decodeURIComponent(ssoStr));
134
-        ssoJson = JSON.parse(ssoStr);
135
-      }
136
       var postData = this.isSSo
126
       var postData = this.isSSo
137
-        ? { username: ssoJson.a, password: ssoJson.u, t: false }
127
+        ? { type: 'pc' }
138
         : { username: this.zhanghao, password: this.mima };
128
         : { username: this.zhanghao, password: this.mima };
139
-      this.$http.post("/service/auth/loginEncrypt", postData).then(res => {
129
+      this.$http.post("/service/auth/sslLogin", postData).then(res => {
140
         that.loading = false;
130
         that.loading = false;
141
         if (res.data && res.data.state == 200) {
131
         if (res.data && res.data.state == 200) {
142
           localStorage.setItem("loginUser", JSON.stringify(res.data.data.user));
132
           localStorage.setItem("loginUser", JSON.stringify(res.data.data.user));
@@ -145,6 +135,10 @@ export default {
145
             JSON.stringify(res.data.data.requester)
135
             JSON.stringify(res.data.data.requester)
146
           );
136
           );
147
           this.getConfig(res.data.data.user,res.data.data.requester);
137
           this.getConfig(res.data.data.user,res.data.data.requester);
138
+        }else if (res.data && res.data.state == 501) {
139
+          var user = JSON.parse(localStorage.getItem('loginUser'));
140
+          var requester = JSON.parse(localStorage.getItem('login_requester'));
141
+          user && requester && this.getConfig(user,requester);
148
         } else {
142
         } else {
149
           that
143
           that
150
             .$createDialog({
144
             .$createDialog({
@@ -233,11 +227,7 @@ export default {
233
     }
227
     }
234
   },
228
   },
235
   created() {
229
   created() {
236
-    if (location.search.length > 0) {
237
-      this.isSSo = Boolean(this.getQueryString("t"));
238
-    } else {
239
-      this.isSSo = false;
240
-    }
230
+    this.isSSo = true;
241
     if (this.isSSo) {
231
     if (this.isSSo) {
242
       this.zlogin();
232
       this.zlogin();
243
     }
233
     }