mirror of
https://gitee.com/chu1204505056/vue-admin-beautiful.git
synced 2025-05-01 12:36:34 +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') {
|
} else if (authentication === 'all') {
|
||||||
accessRoutes = await store.dispatch('routes/setAllRoutes')
|
accessRoutes = await store.dispatch('routes/setAllRoutes')
|
||||||
}
|
}
|
||||||
router.addRoutes(accessRoutes)
|
accessRoutes.forEach((item) => {
|
||||||
|
router.addRoute(item)
|
||||||
|
})
|
||||||
next({ ...to, replace: true })
|
next({ ...to, replace: true })
|
||||||
} catch {
|
} catch {
|
||||||
await store.dispatch('user/resetAccessToken')
|
await store.dispatch('user/resetAccessToken')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user