浏览代码

自动登录

xiaohaizhao 4 月之前
父节点
当前提交
1b420c4dc5
共有 1 个文件被更改,包括 18 次插入0 次删除
  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',
+                });
+            }
+        })
+    }
 });
 
 // 登陆按钮相关