export default [
  { path: '/', redirect: '/index' },
  /* 测试页面 */
  { path: '/test', name: 'test', component: () => import('../pages/test.vue') },
  /* 课程检测 */
  {
    path: '/exam/index',
    name: 'examIndex',
    component: () => import('../pages/courseExam/index.vue')
  },
  /* 能力自测答题页面 */
  {
    path: '/exam/answer',
    name: 'examAnswer',
    component: () => import('../pages/courseExam/answer.vue'),
    meta: { requiredLogin: true }
  },
  /* 能力自测答题结果 */
  {
    path: '/exam/result',
    name: 'examResult',
    component: () => import('../pages/courseExam/answerResult.vue'),
    meta: { requiredLogin: true }
  },
  /* 能力自测答题结果 */
  {
    path: '/exam/courseNode',
    name: 'courseNode',
    component: () => import('../pages/courseExam/courseNode.vue'),
    meta: { requiredLogin: true }
  },
  /* 模拟考试 */
  {
    path: '/mock/index',
    name: 'mockIndex',
    component: () => import('../pages/mockExam/index.vue'),
    meta: { requiredLogin: true }
  },
  /* 模拟考试答题页面 */
  {
    path: '/mock/answer',
    name: 'mockAnswer',
    component: () => import('../pages/mockExam/answer.vue'),
    meta: { requiredLogin: true }
  },
  /* 模拟考试答题页面 */
  {
    path: '/mock/result',
    name: 'mockResult',
    component: () => import('../pages/mockExam/answerResult.vue'),
    meta: { requiredLogin: true }
  },
  /* 如果所有页面都没找到 - 指向 */
  { path: '*', component: () => import('@/components/errorPages/404.vue') },
  /* 首页 */
  {
    path: '/index',
    name: 'index',
    component: () => import('../pages/home/index.vue')
  },
  // 搜索
  {
    path: '/search',
    name: 'search',
    component: () => import('../pages/search/index.vue')
  },
  // 课程学习
  {
    path: '/course/learn',
    name: 'courseLearn',
    component: () => import('../pages/course/learn/index.vue'),
    meta: { requiredLogin: true }
  },
  // 课程学习详情
  {
    path: '/course/learn/:id',
    name: 'courseLearnItem',
    component: () => import('../pages/course/learn/item.vue'),
    meta: { requiredLogin: true }
  },
  // 课程知识点
  {
    path: '/course/learn/:courseId/tag/:chapterId',
    name: 'courseTag',
    component: () => import('../pages/course/tag/list.vue'),
    meta: { requiredLogin: true }
  },
  // 课程知识点详情
  {
    path: '/course/tag/:id',
    name: 'courseTagItem',
    component: () => import('../pages/course/tag/item.vue'),
    meta: { requiredLogin: true }
  },
  // 登录
  {
    path: '/login',
    name: 'login',
    component: () => import('../pages/login/login.vue')
  },
  // 我的
  {
    path: '/my',
    name: 'my',
    component: () => import('../pages/my/index.vue'),
    meta: { requiredLogin: true }
  },
  // 我的-已购课程
  {
    path: '/my/buyCourses',
    name: 'buyCourses',
    component: () => import('../pages/my/buyCourses.vue'),
    meta: { requiredLogin: true }
  },
  // 我的-已做试题
  {
    path: '/my/exam',
    name: 'examQuestions',
    component: () => import('../pages/my/examQuestions.vue'),
    meta: { requiredLogin: true }
  },
  // 支付
  {
    path: '/pay',
    name: 'pay',
    component: () => import('../pages/pay/index.vue'),
    meta: { requiredLogin: true }
  }
]
