瀏覽代碼

登录修改

seimin 2 年之前
父節點
當前提交
4542ac25b0
共有 1 個文件被更改,包括 7 次插入17 次删除
  1. 7 17
      src/views/Login.vue

+ 7 - 17
src/views/Login.vue

@@ -211,20 +211,10 @@ export default {
211
     zlogin() {
211
     zlogin() {
212
       console.log(this);
212
       console.log(this);
213
       var that = this;
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
       var postData = this.isSSo
214
       var postData = this.isSSo
225
-        ? { username: ssoJson.a, password: ssoJson.u, t: false }
215
+        ? { type: 'pc' }
226
         : { username: this.zhanghao, password: this.mima };
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
         that.loading = false;
218
         that.loading = false;
229
         if (res.data && res.data.state == 200) {
219
         if (res.data && res.data.state == 200) {
230
           localStorage.setItem("loginUser", JSON.stringify(res.data.data.user));
220
           localStorage.setItem("loginUser", JSON.stringify(res.data.data.user));
@@ -234,6 +224,10 @@ export default {
234
             JSON.stringify(res.data.data.requester)
224
             JSON.stringify(res.data.data.requester)
235
           );
225
           );
236
           this.getConfig(res.data.data.user,res.data.data.requester);
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
         } else {
231
         } else {
238
           that
232
           that
239
             .$createDialog({
233
             .$createDialog({
@@ -258,11 +252,7 @@ export default {
258
     }
252
     }
259
   },
253
   },
260
   created() {
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
     if (this.isSSo) {
256
     if (this.isSSo) {
267
       this.zlogin();
257
       this.zlogin();
268
     }
258
     }