// 基础路由 //TIP:未登陆前开放路由可写入该数组
export const defaultRoutes = [
  {
    path: '/',
    redirect: '/login',
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/login'),
    meta: {
      title: "登录页",
    }
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('@/register'),
    meta: {
      title: "注册页",
    }
  },
];

/**
 * TIP : 规则 除开基础配置以外 roles代表角色 permission是权限节点 
 * TIP : meta icon 图标地址 inSideBar 是否在侧边栏菜单显示 inBread是否在面包削显示 cache是否缓存 取的是组件export 对象里的name
 */
// 动态生成路由 //TIP:登录后的路由请务必写入该数组 /home为全局父组件 其他组件需嵌套在该组件children下
export const rolesOfRoutes = [
  {
    path: '/home',
    redirect: "/certificationManagement",
    name: 'Home',
    component: "home",
    meta: {
      permission: [],
      roles: ["normal"],
      inSideBar: true
    },
    children: [
      {
        path: '/certificationManagement',
        name: 'certificationManagement',
        component: "views/certificationManagement",
        meta: {
          title: "认证管理",
          icon: "",
          menuType: "C",
          inSideBar: true,
          inBread: true,
          cache: false,
          permission: [],
          roles: ["normal"],
        },
      },
      {
        path: '/test1',
        name: 'test1',
        component: "catalogue",
        meta: {
          title: "测试目录1",
          icon: "",
          menuType: "M",
          inSideBar: true,
          inBread: true,
          cache: false,
          permission: [],
          roles: ["normal"],
        },
        children: [
          {
            path: '/test2',
            name: 'test2',
            component: "views/test2",
            meta: {
              title: "测试菜单2",
              icon: "",
              menuType: "C",
              inSideBar: true,
              inBread: true,
              cache: false,
              permission: [],
              roles: ["normal"],
            }
          }
        ]
      },
    ]
  },
];