File tree 3 files changed +531
-8
lines changed
3 files changed +531
-8
lines changed Original file line number Diff line number Diff line change 1
1
import Mock from 'mockjs'
2
- // import { deepClone } from '@/utils'
3
- // import { filterAsyncRoutes } from '@/store/modules/permission'
4
- // import { asyncRoutes, constantRoutes } from '@/router'
2
+ import { deepClone } from '../../src/utils/index.js'
3
+ import { asyncRoutes , constantRoutes } from './routes.js'
5
4
6
- // const routes = deepClone([...constantRoutes, ...asyncRoutes])
5
+ const routes = deepClone ( [ ...constantRoutes , ...asyncRoutes ] )
7
6
8
7
const roles = [
9
8
{
10
9
key : 'admin' ,
11
10
name : 'admin' ,
12
11
description : 'Super Administrator. Have access to view all pages.' ,
13
- routes : [ ]
12
+ routes : routes
14
13
} ,
15
14
{
16
15
key : 'editor' ,
17
16
name : 'editor' ,
18
17
description : 'Normal Editor. Can see all pages except permission page' ,
19
- routes : [ ]
18
+ routes : routes . filter ( i => i . path !== '/permission' ) // just a mock
20
19
} ,
21
20
{
22
21
key : 'visitor' ,
@@ -38,7 +37,7 @@ const roles = [
38
37
39
38
export default {
40
39
'/routes' : ( ) => {
41
- return [ ]
40
+ return routes
42
41
} ,
43
42
'/roles' : ( ) => {
44
43
return roles
You can’t perform that action at this time.
0 commit comments