Browse Source

登录完善

seimin 3 years ago
parent
commit
1b730df45f
1 changed files with 15 additions and 2 deletions
  1. 15 2
      src/views/Login.vue

+ 15 - 2
src/views/Login.vue

@@ -200,11 +200,24 @@ export default {
200 200
             .show();
201 201
         }
202 202
       });
203
-    }
203
+    },
204
+    // 获取查询参数
205
+    getQueryString(name) {
206
+    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
207
+    var r = window.location.search.substr(1).match(reg);
208
+    if (r != null){
209
+        return unescape(r[2]);
210
+      }
211
+      return null;
212
+    },
204 213
   },
205 214
   created() {
206 215
     localStorage.clear();
207
-    this.isSSo = location.search.length > 0;
216
+    if(location.search.length > 0){
217
+      this.isSSo = Boolean(this.getQueryString('t'));
218
+    }else{
219
+      this.isSSo = false;
220
+    }
208 221
     if (this.isSSo) {
209 222
       this.zlogin();
210 223
     }