谢杰标 2 лет назад
Родитель
Сommit
3dcda5de00
1 измененных файлов с 13 добавлено и 11 удалено
  1. 13 11
      src/pages/login/index.vue

+ 13 - 11
src/pages/login/index.vue

@@ -297,7 +297,7 @@ export default {
             ...this.params
           })
           .then(res => {
-            this.loginBack(res.data);
+            this.loginBack(res.data, false);
           })
           .catch(() => {
             this.full_Login = false;
@@ -327,16 +327,18 @@ export default {
     /**
      * 微信登入—返回数据
      */
-    loginBack({ url, user_account }) {
-      localStorage.setItem(
-        "user_account",
-        JSON.stringify({
-          value: user_account,
-          expires: 10 * 24 * 60 * 1000, // 10天
-          startTime: new Date().getTime()
-        })
-      );
-      // window.location.replace(url);
+    loginBack({ url, user_account }, isSet = true) {
+      isSet &&
+        localStorage.setItem(
+          "user_account",
+          JSON.stringify({
+            value: user_account,
+            expires: 10 * 24 * 60 * 1000, // 10天
+            startTime: new Date().getTime()
+          })
+        );
+      url += "&user_account=" + user_account;
+      window.location.replace(url);
     },
     login() {
       this.$refs.loginForm.validate(valid => {