Merge pull request #4481 from dataease/pr@dev@fix_router_history

fix(登录): 退出后重新登录路由到历史页面
This commit is contained in:
fit2cloud-chenyw 2023-02-08 11:17:15 +08:00 committed by GitHub
commit babb8a376d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -365,7 +365,7 @@ export default {
if (result !== 'success' && result !== 'fail') {
window.location.href = result
} else {
this.$router.push('/login')
this.$router.push(`/login?redirect=${this.$route.fullPath}`)
}
},
loadUiInfo() {

View File

@ -53,7 +53,7 @@ const routeBefore = (callBack) => {
callBack()
}
}
router.beforeEach(async(to, from, next) => routeBefore(() => {
router.beforeEach(async (to, from, next) => routeBefore(() => {
// start progress bar
NProgress.start()
const mobileIgnores = ['/delink']
@ -118,8 +118,7 @@ router.beforeEach(async(to, from, next) => routeBefore(() => {
next()
} else {
// other pages that do not have permission to access are redirected to the login page.
// next(`/login?redirect=${to.path}`)
next('/login')
next(`/login?redirect=${to.path}`)
NProgress.done()
}
}