Blame view

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

export default permission;