import Vue from 'vue'
import Router from 'vue-router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import home from '@/components/pages/home'
import curriculum from '@/components/pages/curriculum'
import notice from '@/components/pages/notice'
import tutor from '@/components/pages/tutor'
import grouping from '@/components/pages/grouping'
import organization from '@/components/pages/organization'
import jurisdiction from '@/components/pages/jurisdiction'
import login from '@/components/login'
import course from '@/components/pages/courseDetail'
import userManage from '@/components/pages/userManage'
import works from '@/components/pages/works'
import classA from '@/components/pages/class'
// import template from '@/components/pages/template'
import template from '@/components/pages/courseTemplate'

Vue.use(Router).use(ElementUI)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: home,
      meta: {
        requireAuth: true
      }
    },
    {
      path: '/curriculum',
      name: 'curriculum',
      component: curriculum,
      meta: {
        requireAuth: true // 是否需要判断是否登录,这里是需要判断
      }
    },
    {
      path: '/template',
      name: 'template',
      component: template,
      meta: {
        requireAuth: true // 是否需要判断是否登录,这里是需要判断
      }
    },
    {
      path: '/course',
      name: 'course',
      component: course,
      meta: {
      }
    },
    {
      path: '/notice',
      name: 'notice',
      component: notice,
      meta: {
        requireAuth: true // 是否需要判断是否登录,这里是需要判断
      }
    },
    {
      path: '/find',
      name: 'find',
      component: () => import('@/components/pages/find'),
      meta: {
        requireAuth: true // 是否需要判断是否登录,这里是需要判断
      }
    },
    {
      path: '/tutor',
      name: 'tutor',
      component: tutor,
      meta: {
        requireAuth: true // 是否需要判断是否登录,这里是需要判断
      }
    },
    {
      path: '/grouping',
      name: 'grouping',
      component: grouping,
      meta: {
        requireAuth: true // 是否需要判断是否登录,这里是需要判断
      }
    },
    {
      path: '/organization',
      name: 'organization',
      component: organization,
      meta: {
        requireAuth: true // 是否需要判断是否登录,这里是需要判断
      }
    },
    {
      path: '/jurisdiction',
      name: 'jurisdiction',
      component: jurisdiction,
      meta: {
        requireAuth: true // 是否需要判断是否登录,这里是需要判断
      }
    },
    {
      path: '/userManage',
      name: 'userManage',
      component: userManage,
      meta: {
        requireAuth: true // 是否需要判断是否登录,这里是需要判断
      }
    },
    {
      path: '/works',
      name: 'works',
      component: works,
      meta: {
        requireAuth: true // 是否需要判断是否登录,这里是需要判断
      }
    },
    {
      path: '/class',
      name: 'class',
      component: classA,
      meta: {
        requireAuth: true // 是否需要判断是否登录,这里是需要判断
      }
    },
    {
      path: '/login',
      name: 'login',
      component: login,
      meta: {
        requireAuth: '' // 不需要鉴权
      }
    }
  ]
})
