import type { RouteRecordRaw } from 'vue-router';
import TestPage from '@/pages/Test/index.vue'
import Test from '@/pages/Test/Test.vue'
import SystemPage from '@/pages/System/index.vue';

export const authRoutes: RouteRecordRaw[] = [
  {
    path: 'system',
    name: 'System',
    component: SystemPage,
    redirect: '/app/system/user',
    meta: {
      icon: 'SettingOutlined',
      title: '系统设置'
    },
    children: [
      {
        path: 'user',
        name: 'SystemUser',
        component: () => import('@/pages/System/User/index.vue'),
        meta: {
          auth: 1,
          title: '用户管理'
        }
      },
      {
        path: 'role',
        name: 'SystemRole',
        component: () => import('@/pages/System/Role/index.vue'),
        meta: {
          auth: 1,
          title: '角色管理'
        }
      }
    ]

  },
  {
    path: 'common',
    name: 'Common',
    component: () => import('@/pages/Common/index.vue'),
    meta: {
      icon: 'AppstoreOutlined',
      title: '通用页面'
    }
  },
  {
    path: 'test',
    name: 'Test',
    component: TestPage,
    redirect: '/test/1',
    meta: {
      icon: 'ApiOutlined',
      title: '测试路由权限'
    },
    children: [
      {
        path: '1',
        name: 'Test1',
        component: Test,
        meta: {
          auth: 1
        }
      },
      {
        path: '2',
        name: 'Test2',
        component: () => import('@/pages/Test/Test.vue'),
        meta: {
          auth: 1
        }
      },
      {
        path: '3',
        name: 'Test3',
        component: Test,
        meta: {
          auth: 2
        }
      },
      {
        path: '4',
        name: 'Test4',
        component: () => import('@/pages/Test/Test.vue'),
        meta: {
          auth: 2
        }
      }
    ]
  }
]
