Browse Source

Merge branch 'wx-handle' of http://git.dashitech.com/seimin/zuel-itsm-3.0.2 into wx-handle

seimin 2 years ago
parent
commit
0958c06787
1 changed files with 7 additions and 17 deletions
  1. 7 17
      src/views/Login.vue

+ 7 - 17
src/views/Login.vue

@@ -211,20 +211,10 @@ export default {
211 211
     zlogin() {
212 212
       console.log(this);
213 213
       var that = this;
214
-      var ssoStr = "";
215
-      var ssoJson;
216
-      if (this.isSSo) {
217
-        ssoStr = location.search
218
-          .replace("?", "")
219
-          .split("&")[0]
220
-          .split("=")[1];
221
-        ssoStr = decode(decodeURIComponent(ssoStr));
222
-        ssoJson = JSON.parse(ssoStr);
223
-      }
224 214
       var postData = this.isSSo
225
-        ? { username: ssoJson.a, password: ssoJson.u, t: false }
215
+        ? { type: 'pc' }
226 216
         : { username: this.zhanghao, password: this.mima };
227
-      this.$http.post("service/auth/loginEncrypt", postData).then(res => {
217
+      this.$http.post("service/auth/sslLogin", postData).then(res => {
228 218
         that.loading = false;
229 219
         if (res.data && res.data.state == 200) {
230 220
           localStorage.setItem("loginUser", JSON.stringify(res.data.data.user));
@@ -234,6 +224,10 @@ export default {
234 224
             JSON.stringify(res.data.data.requester)
235 225
           );
236 226
           this.getConfig(res.data.data.user,res.data.data.requester);
227
+        }else if (res.data && res.data.state == 501) {
228
+          var user = JSON.parse(localStorage.getItem('loginUser'));
229
+          var requester = JSON.parse(localStorage.getItem('login_requester'));
230
+          user && requester && this.getConfig(user,requester);
237 231
         } else {
238 232
           that
239 233
             .$createDialog({
@@ -258,11 +252,7 @@ export default {
258 252
     }
259 253
   },
260 254
   created() {
261
-    if (location.search.length > 0) {
262
-      this.isSSo = Boolean(this.getQueryString("t"));
263
-    } else {
264
-      this.isSSo = false;
265
-    }
255
+    this.isSSo = true;
266 256
     if (this.isSSo) {
267 257
       this.zlogin();
268 258
     }