From 1d3eb92d48e0508f5a3b3d414d8e374b3e6c73b3 Mon Sep 17 00:00:00 2001 From: huziyuan Date: Tue, 26 Jan 2021 11:10:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=99=BB=E9=99=86=E5=9B=9B?= =?UTF-8?q?=E4=B8=AA=E9=A1=B5=E9=9D=A2=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/setting/index.js | 1 + pages/index/index.js | 6 ++++-- pages/login/index.js | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pages/home/setting/index.js b/pages/home/setting/index.js index 2cffdfd..4adbe1f 100644 --- a/pages/home/setting/index.js +++ b/pages/home/setting/index.js @@ -53,6 +53,7 @@ Page({ onTap(e) { storage.remove('userToken') storage.remove('Authorization') + storage.remove('isTokenHaveStatus') app.globalData.token = null app.globalData.userInfo = null finalizeToken() diff --git a/pages/index/index.js b/pages/index/index.js index 5049a0b..ded996c 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -168,6 +168,7 @@ Page({ zconfig.header = { 'Authorization': 'QNT ' + result.data.token } pconfig.header = { 'Authorization': 'QNT ' + result.data.token } mconfig.header = { 'Authorization': 'QNT ' + result.data.token } + storage.put('isTokenHaveStatus', true) this.dataset({ isTokenHaveStatus:true }) @@ -241,6 +242,8 @@ Page({ this.onResume() } // wx.navigateTo({ url: '/pages/home/tab1/index' }) + var a=storage.get('isTokenHaveStatus') + if(a==true){ getBaseInfo().then(result => { this.setData({ hasShowedLoginTag: result.data.hasShowedLoginTag @@ -254,8 +257,7 @@ Page({ }) } }) - - + } }, updateUserInfoFct: function (model) { updateUserInfo(model).then(result => {}) diff --git a/pages/login/index.js b/pages/login/index.js index c8c2ef0..ecaede2 100644 --- a/pages/login/index.js +++ b/pages/login/index.js @@ -71,6 +71,7 @@ Page({ authCode: res.code }).then(result => { storage.put('tmpAuthToken', result.data.tmpAuthToken, 98) + storage.put('isTokenHaveStatus', true) }) } })