🐛fix(*): 优化登陆失效后跳转到登陆界面到问题

This commit is contained in:
jmal 2022-07-24 12:12:27 +08:00
parent 6a9d588223
commit 6eaddcbd58

View File

@ -41,9 +41,10 @@ router.beforeEach(async(to, from, next) => {
// 删除token,然后转到登录页面重新登录
await store.dispatch('user/resetToken')
if (to.path === '/404') {
to.path = '/'
next(`/login`)
} else {
next(`/login?redirect=${to.path}`)
}
next(`/login?redirect=${to.path}`)
NProgress.done()
}
}
@ -102,6 +103,7 @@ function findPath(menuList, to, parentPath){
}
}
if(parentPath){
console.log("parentPath", parentPath)
menu.path = parentPath + '/' + menu.path
}
if(menu.path === to) return true