import Auth from '@/views/layout/auth'
import { router, rootRouter } from './routes-common'

/**
 * 配置类型
 */
type metaType = {
  isRegister: boolean // 是否可注册
}

// 不需要登录的路由
const noLoginRouter = []

export default [
  {
    path: '/',
    component: Auth,
    children: [
      ...router,
      {
        path: '/login',
        name: 'login',
        component: () => import('@/views/layout/login'),
        meta: {
          isRegister: false
        } as metaType
      },
      {
        path: '/home',
        name: 'home',
        component: () => import('@/teacher/home/index')
      },
      {
        path: '/exercise-record',
        name: 'exercise-record',
        component: () => import('@/views/exercise-record'),
        meta: {
          title: '练习记录'
        }
      },
      {
        path: '/exercis-detail',
        name: 'exercis-detail',
        component: () => import('@/views/exercise-record/exercis-detail'),
        meta: {
          title: '测评详情'
        }
      },
      {
        path: '/attendance',
        name: 'attendance',
        component: () => import('@/teacher/attendance/index'),
        meta: {
          title: '我的考勤'
        }
      },
      {
        path: '/teacher-attendDetail',
        name: 'teacher-attendDetail',
        component: () => import('@/school/attendance/components/teacher-attendDetail'),
        meta: {
          title: '考勤详情'
        }
      },
      {
        path: '/attendance-rule',
        name: 'attendance-rule',
        component: () => import('@/views/attendance-rule/index'),
        meta: {
          title: '考勤规则'
        }
      },
      {
        path: '/screen-projection',
        name: 'screen-projection',
        component: () => import('@/teacher/screen-projection/index'),
        meta: {
          title: '教学课件'
        }
      }
    ]
  },
  ...rootRouter,
  ...noLoginRouter
]
