try { | try { | ||||
// await userStore.getUserInfo() | // await userStore.getUserInfo() | ||||
const routes = await permissionStore.generateRoutes() | const routes = await permissionStore.generateRoutes() | ||||
router.addRoute(routes[0]) | |||||
routes.forEach((item) => { | |||||
router.addRoute(item) | |||||
}) | |||||
router.addRoute(NOT_FOUND_ROUTE) | router.addRoute(NOT_FOUND_ROUTE) | ||||
router.addRoute(REDIRECT_ROUTE) | router.addRoute(REDIRECT_ROUTE) | ||||
next({ ...to, replace: true }) | next({ ...to, replace: true }) |