forked from github/dataease
Merge pull request #4481 from dataease/pr@dev@fix_router_history
fix(登录): 退出后重新登录路由到历史页面
This commit is contained in:
commit
babb8a376d
@ -365,7 +365,7 @@ export default {
|
|||||||
if (result !== 'success' && result !== 'fail') {
|
if (result !== 'success' && result !== 'fail') {
|
||||||
window.location.href = result
|
window.location.href = result
|
||||||
} else {
|
} else {
|
||||||
this.$router.push('/login')
|
this.$router.push(`/login?redirect=${this.$route.fullPath}`)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loadUiInfo() {
|
loadUiInfo() {
|
||||||
|
@ -53,7 +53,7 @@ const routeBefore = (callBack) => {
|
|||||||
callBack()
|
callBack()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
router.beforeEach(async(to, from, next) => routeBefore(() => {
|
router.beforeEach(async (to, from, next) => routeBefore(() => {
|
||||||
// start progress bar
|
// start progress bar
|
||||||
NProgress.start()
|
NProgress.start()
|
||||||
const mobileIgnores = ['/delink']
|
const mobileIgnores = ['/delink']
|
||||||
@ -118,8 +118,7 @@ router.beforeEach(async(to, from, next) => routeBefore(() => {
|
|||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
// other pages that do not have permission to access are redirected to the login page.
|
// other pages that do not have permission to access are redirected to the login page.
|
||||||
// next(`/login?redirect=${to.path}`)
|
next(`/login?redirect=${to.path}`)
|
||||||
next('/login')
|
|
||||||
NProgress.done()
|
NProgress.done()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user