修复退出登录问题

main
26947 2024-05-05 21:19:38 +08:00
parent 092bdd59c9
commit 51471dc567
3 changed files with 9 additions and 5 deletions

View File

@ -24,7 +24,8 @@
"navigationBarTitleText": "若依移动端框架",
"navigationStyle": "custom"
}
}, {
}
, {
"path": "pages/work/index",
"style": {
"navigationBarTitleText": "工作台"
@ -90,7 +91,8 @@
"iconPath": "static/images/tabbar/home.png",
"selectedIconPath": "static/images/tabbar/home_.png",
"text": "首页"
}, {
}
, {
"pagePath": "pages/work/index",
"iconPath": "static/images/tabbar/work.png",
"selectedIconPath": "static/images/tabbar/work_.png",

View File

@ -50,7 +50,7 @@
handleLogout() {
this.$modal.confirm('确定注销并退出系统吗?').then(() => {
this.$store.dispatch('LogOut').then(() => {
this.$tab.reLaunch('/')
this.$tab.reLaunch('/pages/loginInfo/login')
})
})
}

View File

@ -5,7 +5,7 @@ const loginPage = "/pages/loginInfo/login"
// 页面白名单
const whiteList = [
'pages/loginInfo/login', '/pages/register', '/pages/common/webview/index'
'/pages/loginInfo/login', '/pages/register', '/pages/common/webview/index'
]
// 检查地址白名单
@ -19,8 +19,10 @@ let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"]
list.forEach(item => {
uni.addInterceptor(item, {
invoke(to) {
if (getToken()) {
if (to.url === loginPage) {
console.log("to:",to);
uni.reLaunch({ url: "/" })
}
return true
@ -33,7 +35,7 @@ list.forEach(item => {
}
},
fail(err) {
console.log(err)
console.log("错误信息:",err)
}
})
})