Vben
2021-03-01 37669d067c43a3807df848f0caf67cbeab3e1b33
提交 | 用户 | age
2f6253 1 import type { AppRouteModule } from '/@/router/types';
2
c303ec 3 import { getParentLayout, LAYOUT } from '/@/router/constant';
2f6253 4 import { RoleEnum } from '/@/enums/roleEnum';
a0b05e 5 import { t } from '/@/hooks/web/useI18n';
2f6253 6
fc4666 7 const permission: AppRouteModule = {
c303ec 8   path: '/permission',
V 9   name: 'Permission',
10   component: LAYOUT,
11   redirect: '/permission/front/page',
12   meta: {
37669d 13     icon: 'ion:key-outline',
a0b05e 14     title: t('routes.demo.permission.permission'),
2f6253 15   },
16
c303ec 17   children: [
2f6253 18     {
c303ec 19       path: 'front',
2f6253 20       name: 'PermissionFrontDemo',
c303ec 21       component: getParentLayout('PermissionFrontDemo'),
2f6253 22       meta: {
a0b05e 23         title: t('routes.demo.permission.front'),
2f6253 24       },
25       children: [
26         {
27           path: 'page',
fc4666 28           name: 'FrontPageAuth',
2f6253 29           component: () => import('/@/views/demo/permission/front/index.vue'),
30           meta: {
a0b05e 31             title: t('routes.demo.permission.frontPage'),
2f6253 32           },
33         },
34         {
35           path: 'btn',
fc4666 36           name: 'FrontBtnAuth',
2f6253 37           component: () => import('/@/views/demo/permission/front/Btn.vue'),
38           meta: {
a0b05e 39             title: t('routes.demo.permission.frontBtn'),
2f6253 40           },
41         },
42         {
43           path: 'auth-pageA',
fc4666 44           name: 'FrontAuthPageA',
2f6253 45           component: () => import('/@/views/demo/permission/front/AuthPageA.vue'),
46           meta: {
a0b05e 47             title: t('routes.demo.permission.frontTestA'),
2f6253 48             roles: [RoleEnum.SUPER],
49           },
50         },
51         {
52           path: 'auth-pageB',
fc4666 53           name: 'FrontAuthPageB',
2f6253 54           component: () => import('/@/views/demo/permission/front/AuthPageB.vue'),
55           meta: {
a0b05e 56             title: t('routes.demo.permission.frontTestB'),
2f6253 57             roles: [RoleEnum.TEST],
58           },
59         },
60       ],
61     },
62     {
c303ec 63       path: 'back',
2f6253 64       name: 'PermissionBackDemo',
c303ec 65       component: getParentLayout('PermissionBackDemo'),
2f6253 66       meta: {
a0b05e 67         title: t('routes.demo.permission.back'),
2f6253 68       },
69       children: [
70         {
71           path: 'page',
fc4666 72           name: 'BackAuthPage',
2f6253 73           component: () => import('/@/views/demo/permission/back/index.vue'),
74           meta: {
a0b05e 75             title: t('routes.demo.permission.backPage'),
2f6253 76           },
77         },
78         {
79           path: 'btn',
fc4666 80           name: 'BackAuthBtn',
2f6253 81           component: () => import('/@/views/demo/permission/back/Btn.vue'),
82           meta: {
a0b05e 83             title: t('routes.demo.permission.backBtn'),
2f6253 84           },
85         },
86       ],
87     },
88   ],
fc4666 89 };
V 90
91 export default permission;