update permission.js

This commit is contained in:
不做码农 2022-05-06 15:54:34 +08:00
parent c70c15646e
commit b6ec1d2e54

View File

@ -11,15 +11,13 @@ const modules =
const permission = { const permission = {
state: { state: {
routes: [], routes: [],
addRoutes: [],
defaultRoutes: [], defaultRoutes: [],
topbarRouters: [], topbarRouters: [],
sidebarRouters: [] sidebarRouters: []
}, },
mutations: { mutations: {
SET_ROUTES: (state, routes) => { SET_ROUTES: (state, routes) => {
state.addRoutes = routes state.routes = constantRoutes.concat(routes)
state.routes = constantRoutes.concat(routes)
}, },
SET_DEFAULT_ROUTES: (state, routes) => { SET_DEFAULT_ROUTES: (state, routes) => {
state.defaultRoutes = constantRoutes.concat(routes) state.defaultRoutes = constantRoutes.concat(routes)
@ -66,7 +64,7 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
route.component = Layout route.component = Layout
} else if (route.component === 'ParentView') { } else if (route.component === 'ParentView') {
route.component = ParentView route.component = ParentView
} }
// else if (route.component === 'InnerLink') { // else if (route.component === 'InnerLink') {
// route.component = InnerLink // route.component = InnerLink
// } // }