vue-router use addRoute

parent 72300e48
......@@ -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')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment