fix:退出登录 直接返回登录页面

This commit is contained in:
zyh
2023-03-09 18:06:45 +08:00
parent 9aada00e4f
commit 362b2f5863
3 changed files with 7 additions and 6 deletions

View File

@@ -181,8 +181,7 @@ export default {
logout () {
this.$get('logout').then(() => {
this.logoutSuccess()
window.location.href = '/'
// this.$router.push('/login')
window.location.href = '/ui/login'
})
},
showPinDialog () {

View File

@@ -103,11 +103,11 @@ axios.interceptors.response.use(
return response
}
if (licenceErrorCode.indexOf(response.data.code) !== -1 && noJumpPath.indexOf(window.location.pathname) == -1) {
sessionStorage.setItem('nz-previous-page', router.currentRoute.fullPath + '1')
sessionStorage.setItem('nz-previous-page', router.currentRoute.fullPath)
window.location.href = '/'
} else if (response.status === 200) {
if (accountErrorCode.indexOf(response.data.code) !== -1 && noJumpPath.indexOf(window.location.pathname) == -1) {
sessionStorage.setItem('nz-previous-page', router.currentRoute.fullPath + '2')
sessionStorage.setItem('nz-previous-page', router.currentRoute.fullPath)
window.location.href = '/'
}
} else {

View File

@@ -149,7 +149,7 @@ router.beforeEach((to, from, next) => {
resolve()
} else {
localStorage.removeItem('nz-token')
sessionStorage.setItem('nz-previous-page', to.fullPath + '5')
sessionStorage.setItem('nz-previous-page', to.fullPath)
next({ path: '/login' })
}
})
@@ -180,7 +180,9 @@ router.beforeEach((to, from, next) => {
if (loginWhiteList.indexOf(to.path) !== -1) {
next()
} else {
sessionStorage.setItem('nz-previous-page', to.fullPath + '6')
console.log(to.path)
console.log(from.path)
sessionStorage.setItem('nz-previous-page', to.fullPath)
next({ path: '/login' })
}
}