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) }) } })