permission.ts 1.9 KB
Newer Older
陈文彬 已提交
1 2 3 4 5 6 7 8 9 10
import type { AppRouteModule } from '/@/router/types';

import { PAGE_LAYOUT_COMPONENT } from '/@/router/constant';
import { RoleEnum } from '/@/enums/roleEnum';

export default {
  layout: {
    path: '/permission',
    name: 'Permission',
    component: PAGE_LAYOUT_COMPONENT,
N
nebv 已提交
11
    redirect: '/permission/front/page',
陈文彬 已提交
12
    meta: {
N
nebv 已提交
13
      icon: 'carbon:user-role',
陈文彬 已提交
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
      title: '权限管理',
    },
  },

  routes: [
    {
      path: '/front',
      name: 'PermissionFrontDemo',
      meta: {
        title: '基于前端权限',
      },
      children: [
        {
          path: 'page',
          component: () => import('/@/views/demo/permission/front/index.vue'),
          meta: {
            title: '页面权限',
          },
        },
        {
          path: 'btn',
          component: () => import('/@/views/demo/permission/front/Btn.vue'),
          meta: {
            title: '按钮权限',
          },
        },
        {
          path: 'auth-pageA',
          component: () => import('/@/views/demo/permission/front/AuthPageA.vue'),
          meta: {
            title: '权限测试页A',
            roles: [RoleEnum.SUPER],
          },
        },
        {
          path: 'auth-pageB',
          component: () => import('/@/views/demo/permission/front/AuthPageB.vue'),
          meta: {
            title: '权限测试页B',
            roles: [RoleEnum.TEST],
          },
        },
      ],
    },
    {
      path: '/back',
      name: 'PermissionBackDemo',
      meta: {
        title: '基于后台权限',
      },
      children: [
        {
          path: 'page',
          component: () => import('/@/views/demo/permission/back/index.vue'),
          meta: {
            title: '页面权限',
          },
        },
        {
          path: 'btn',
          component: () => import('/@/views/demo/permission/back/Btn.vue'),
          meta: {
            title: '按钮权限',
          },
        },
      ],
    },
  ],
} as AppRouteModule;