zs 1 سال پیش
والد
کامیت
adfa4247dc
1فایلهای تغییر یافته به همراه3 افزوده شده و 5 حذف شده
  1. 3 5
      pages/index/index.js

+ 3 - 5
pages/index/index.js

@@ -5,7 +5,6 @@ Page({
      * 页面的初始数据
      */
     data: {
-        basicInfo: {},
         logo: '',
     },
     /**
@@ -30,7 +29,7 @@ Page({
         wx.showLoading({ title: '加载中', mask: true })
         await that.searchConfig()
         // 监听用户是否登录
-        await this.watchLogin();
+        await that.watchLogin();
         wx.hideLoading()
     },
     async searchConfig() {
@@ -53,16 +52,15 @@ Page({
                 const { code: js_code } = arr;
                 const { wx_config } = app.globalData;
                 wx.getStorage({
-                    key: 'token',
+                    key: 'openid',
                     success(res) {
                         if (res.data) wx.redirectTo({ url: '/pagesHome/home/index' })
                     },
                     async fail(err) {
-                        wx.redirectTo({ url: '/pagesHome/home/index' })
                         const aee = await app.$api('token/app', 'GET', { js_code: js_code, config: wx_config.config });
                         if (aee.errcode == '0') {
                             wx.setStorage({ key: "openid", data: aee.data.openid })
-                            wx.redirectTo({ url: '/pagesCommon/login/index' })
+                            wx.redirectTo({ url: '/pagesHome/home/index' })
                         } else {
                             wx.showToast({ title: `${aee.errmsg}`, icon: 'none' });
                         }