
export default [
  { path: '/', redirect: '/login/index' },
  {
    path: '/login/index',
    name: 'login-normal',
    component: () => import('@/pages/login/index.vue'),
    props: (route) => ({ query: route.query, params: route.params })
  },
  {
    path: '/login/code',
    name: 'login-code',
    component: () => import('@/pages/login/code.vue'),
    props: (route) => ({ query: route.query, params: route.params })
  },
  {
    path: '/login/forget',
    name: 'login-forget',
    component: () => import('@/pages/login/forget.vue'),
    props: (route) => ({ query: route.query, params: route.params })
  },
  /* App 内登录页面未找到时 - 指向 */
  { path: '/login/*', redirect: '/login/index' },
  /* 学习系统 - 登录后，进入页面 */
  {
    path: '/app',
    redirect: '/app/error/404',
    component: () => import('@/pages/mainsite.vue'),
    children: [
      { path: 'error/404', component: () => import('@/components/errorPages/404.vue') },
      {
        path: 'other',
        redirect: 'error/404',
        component: () => import('@/components/learnSysLayout/container.vue'),
        children: [
          { path: 'message', component: () => import('../pages/other/message.vue') }
        ]
      },
      {
        path: 'learn',
        redirect: 'error/404',
        component: () => import('@/components/learnSysLayout/container.vue'),
        children: [
          { path: 'course', component: () => import('../pages/learn/course.vue') },
          { path: 'course-all', component: () => import('../pages/learn/courseAll.vue') },
          { path: 'course-detail/:sid/:cid', component: () => import('../pages/learn/courseDetail.vue'), props: true },
          // { path: 'discuss-detail/:sid/:cid/:id', component: () => import('../pages/learn/discussDetail.vue'), props: true },
          // { path: 'discussion', component: () => import('../pages/learn/discussion.vue') },
          { path: 'report-list', component: () => import('../pages/learn/reportList.vue') },
          { path: 'report-active-list', component: () => import('../pages/learn/reportActiveList.vue') },
          { path: 'report-list-all/:rid', component: () => import('../pages/learn/reportListAll.vue'), props: true },
          { path: 'report-add/:rid', component: () => import('../pages/learn/reportAdd.vue'), props: true },
          { path: 'report-submit/:rid/:reid', component: () => import('../pages/learn/reportSubmit.vue'), props: true }
        ]
      },
      {
        path: 'grade',
        redirect: 'error/404',
        component: () => import('@/components/learnSysLayout/container.vue'),
        children: [
          { path: 'credit', component: () => import('../pages/grade/credit.vue') },
          { path: 'rebuild', component: () => import('../pages/grade/rebuild.vue') }
        ]
      },
      {
        path: 'account',
        redirect: 'error/404',
        component: () => import('@/components/learnSysLayout/container.vue'),
        children: [
          // { path: 'set-pwd', component: () => import('../pages/account/setPwd.vue') },
          // { path: 'update-pic', component: () => import('../pages/account/updatePic.vue') },
          // { path: 'feedbackList', component: () => import('../pages/account/feedbackList.vue') },
          // { path: 'feedbackCreate', component: () => import('../pages/account/feedbackCreate.vue') }
        ]
      },
      {
        path: 'service-hall',
        redirect: 'error/404',
        component: () => import('@/components/learnSysLayout/container.vue'),
        children: [
          // { path: 'hall', component: () => import('../pages/serviceHall/hall.vue') },
          // { path: 'learning-add/:rid', component: () => import('../pages/serviceHall/learningAdd.vue'), props: true },
          // { path: 'share-add/:rid', component: () => import('../pages/serviceHall/shareAdd.vue'), props: true },
          // { path: 'again-add/:rid', component: () => import('../pages/serviceHall/againAdd.vue'), props: true },
          // { path: 'my-apply', component: () => import('../pages/serviceHall/myApply.vue'), props: true },
          // { path: 'upload-report/:rid/:reid', component: () => import('../pages/serviceHall/uploadReport.vue'), props: true },
          // { path: 'view-report/:rid', component: () => import('../pages/serviceHall/viewReport.vue'), props: true }
        ]
      }
    ]
  },
  /* 如果所有页面都没找到 - 指向 */
  { path: '*', component: () => import('@/components/errorPages/404.vue') }
]
