Compare commits

..

No commits in common. "b568b40f957f9434a8ef061ec52be9c0d8ed0992" and "767be63febb2b4de516a6d4f697690c0324fc9e1" have entirely different histories.

1 changed files with 2 additions and 7 deletions

View File

@ -92,13 +92,8 @@ router.beforeEach(async (to, from, next) => {
await store.dispatch('user/getUserInfo')
const accessRoutes = await store.dispatch('permission/generateRoutes')
resetRouter()
if (accessRoutes.length > 0) {
router.addRoutes(accessRoutes)
next({ ...to, replace: true })
} else {
next()
}
router.addRoutes(accessRoutes)
next({ ...to, replace: true })
} catch (error) {
console.log(error)
// 删除token并进入登录页面以重新登录