fix allow route management only in dev env
This commit is contained in:
parent
55a2deace8
commit
13f597b3dd
|
@ -167,15 +167,6 @@ export const asyncRoutes = [
|
||||||
title: 'Role Permission',
|
title: 'Role Permission',
|
||||||
roles: ['admin']
|
roles: ['admin']
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'path',
|
|
||||||
component: () => import('@/views/permission/route'),
|
|
||||||
name: 'Route',
|
|
||||||
meta: {
|
|
||||||
title: 'Route',
|
|
||||||
roles: ['admin']
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -404,6 +395,26 @@ const createRouter = () => new Router({
|
||||||
|
|
||||||
const router = createRouter()
|
const router = createRouter()
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV === 'development') {
|
||||||
|
router.addRoutes([
|
||||||
|
{
|
||||||
|
path: '/',
|
||||||
|
component: Layout,
|
||||||
|
redirect: '/dashboard',
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'route',
|
||||||
|
component: () => import('@/views/permission/route'),
|
||||||
|
name: 'Route',
|
||||||
|
meta: {
|
||||||
|
title: 'Route',
|
||||||
|
roles: ['admin']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}])
|
||||||
|
}
|
||||||
|
|
||||||
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
|
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
|
||||||
export function resetRouter() {
|
export function resetRouter() {
|
||||||
const newRouter = createRouter()
|
const newRouter = createRouter()
|
||||||
|
|
Loading…
Reference in New Issue