Browse Source

routers

pull/7/head
zhangtao 2 years ago
parent
commit
5f2f23258c
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/router/guard/permission-guard.js

+ 3
- 1
src/router/guard/permission-guard.js View File

@@ -20,7 +20,9 @@ export function createPermissionGuard(router) {
try {
// await userStore.getUserInfo()
const routes = await permissionStore.generateRoutes()
router.addRoute(routes[0])
routes.forEach((item) => {
router.addRoute(item)
})
router.addRoute(NOT_FOUND_ROUTE)
router.addRoute(REDIRECT_ROUTE)
next({ ...to, replace: true })

Loading…
Cancel
Save