From 607e13f266951d09ff1dbbed9324206397c92aa2 Mon Sep 17 00:00:00 2001 From: xiaozhiyong Date: Fri, 19 Jan 2024 13:39:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 26 +++++++++++++++++++------- BagStation/orderDetail/orderDetail.vue | 2 +- pages/index/startPage/startPage.vue | 16 ++++++++-------- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/App.vue b/App.vue index 3d42bb1..7fabfde 100644 --- a/App.vue +++ b/App.vue @@ -67,7 +67,7 @@ value: item.id }) }) - console.log(channelCodes, productCodes, siteBrands) + // console.log(channelCodes, productCodes, siteBrands) this.menuList[0].detailList = this.menuList[0].detailList.concat(channelCodes) this.menuList[1].detailList = this.menuList[1].detailList.concat(productCodes) this.menuList[2].detailList = this.menuList[2].detailList.concat(siteBrands) @@ -95,10 +95,12 @@ if(view.route === 'BagStation/pages/stationDetail/stationDetail') { uni.removeStorageSync('refuseLogin') } + // console.log('white.includes(view.route)',white.includes(view.route)) // // 是否跳过登陆 let isRefuseLogin = uni.getStorageSync('refuseLogin') if(isRefuseLogin || white.includes(view.route) || view.route.includes('BagAuth')) return - this.getAmount() + // console.log('111111111111111') + this.getAmount() }) }, // 是否token过期或ip更改 @@ -106,10 +108,14 @@ // clearTimeout(loginTimer) accountApi.getTotalOilCardInfo().then(res => { if (res.code == 42011) { + uni.setStorageSync('Authorization',null) + uni.setStorageSync('openid',null) + uni.showModal({ title: '需要您重新登录', content: res.msg, duration: '3000', + showCancel:false, success: function(res) { if (res.confirm) { uni.redirectTo({ @@ -125,13 +131,17 @@ onReady() { }, + + onUnload() { + uni.hideLoading() + }, onShow: function(option) { - const token = uni.getStorageSync('Authorization') - const openid = uni.getStorageSync('openid') - if (token && openid) { - this.getAmount() - } + // const token = uni.getStorageSync('Authorization') + // const openid = uni.getStorageSync('openid') + // if (token && openid) { + // this.getAmount() + // } uni.getLocation({ type: 'wgs84', success: function(res) { @@ -142,7 +152,9 @@ } }); }, + } +