This commit is contained in:
caolc
2022-12-07 17:25:15 +08:00
parent f04e3fb063
commit fdd6d6e171
2 changed files with 8 additions and 4 deletions

View File

@@ -75,6 +75,7 @@
},
onShareAppMessage() {
wx.onAppRoute(() => {
let white = ['BagStation/pages/stationDetail/stationDetail']
// console.log('当前页面路由发生变化 触发该事件onShareAppMessage')
const pages = getCurrentPages() //获取加载的页面
const view = pages[pages.length - 1] //获取当前页面的对象
@@ -94,11 +95,14 @@
console.log(view.route)
clearTimeout(loginTimer)
clearTimeout(onlineTimer)
if (view.route != 'pages/index/startPage/startPage' && view.route.indexOf('BagAuth') == -1) {
const token = uni.getStorageSync('Authorization')
const openid = uni.getStorageSync('openid')
if (token && openid) {
this.getAmount()
if(!white.includes(view.route)){
this.getAmount()
}
onlineTimer = setTimeout(() => {
if (this.loginStatus == 'offline') {
uni.clearStorageSync()