Blame view

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

export default permission;