mirror of
https://gitee.com/chu1204505056/vue-admin-beautiful.git
synced 2025-04-06 03:58:00 +08:00
vue-router use addRoute
This commit is contained in:
parent
72300e4822
commit
e54c435ba1
@ -54,7 +54,9 @@ router.beforeResolve(async (to, from, next) => {
|
||||
} else if (authentication === 'all') {
|
||||
accessRoutes = await store.dispatch('routes/setAllRoutes')
|
||||
}
|
||||
router.addRoutes(accessRoutes)
|
||||
accessRoutes.forEach((item) => {
|
||||
router.addRoute(item)
|
||||
})
|
||||
next({ ...to, replace: true })
|
||||
} catch {
|
||||
await store.dispatch('user/resetAccessToken')
|
||||
|
Loading…
x
Reference in New Issue
Block a user