修复退出登录问题
parent
092bdd59c9
commit
51471dc567
|
@ -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",
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
handleLogout() {
|
||||
this.$modal.confirm('确定注销并退出系统吗?').then(() => {
|
||||
this.$store.dispatch('LogOut').then(() => {
|
||||
this.$tab.reLaunch('/')
|
||||
this.$tab.reLaunch('/pages/loginInfo/login')
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue