Browse Source

自动登录

xiaohaizhao 4 months ago
parent
commit
1b420c4dc5
1 changed files with 18 additions and 0 deletions
  1. 18 0
      pages/login/login.vue

+ 18 - 0
pages/login/login.vue

@@ -51,6 +51,24 @@ onLoad(() => {
         phonenumber.value = storedPhone;
         isAgreement.value = true;
     }
+
+    if (wx.getStorageSync('userMsg').token) {
+        $Http.basic({
+            "classname": "common.adspace.adspace",
+            "method": "query_adspacelist", //查询轮播图
+            content: {
+                nocache: true
+            }
+        }).then(res => {
+            if (res.code !== 0) {
+                uni.removeStorageSync('banner')
+                uni.setStorageSync('banner', res.data);
+                uni.redirectTo({
+                    url: '/pages/index/index',
+                });
+            }
+        })
+    }
 });
 
 // 登陆按钮相关