import Vue from 'vue'
import Router from 'vue-router'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import login from '@/components/login'
import index from '@/components/index'
import courseDetail from '@/components/courseDetail'
import mine from '@/components/mine'
import project from '@/components/project'
import works from '@/components/works'
import score from '@/components/score'
import notice from '@/components/notice'
import noticeDetail from '@/components/noticeDetail'
import study from '@/components/study'

Vue.use(Router).use(ElementUI)

export default new Router({
  routes: [
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path:'/',
      redirect:'/index'
    },
    {
      path: '/index',
      name: 'index',
      component: index,
      requireAuth:true
    },
    {
      path: '/courseDetail',
      name: 'courseDetail',
      component: courseDetail,
      requireAuth: true
    },
    {
      path: '/mine',
      name: 'mine',
      component: mine,
      requireAuth: true
    },
    {
      path: '/project',
      name: 'project',
      component: project,
      requireAuth: true
    },
    {
      path: '/works',
      name: 'works',
      component: works,
      requireAuth: true
    },
    {
      path: '/score',
      name: 'score',
      component: score,
      requireAuth: true
    },
    {
      path: '/notice',
      name: 'notice',
      component: notice,
      requireAuth: true
    },
    {
      path: '/noticeDetail',
      name: 'noticeDetail',
      component: noticeDetail,
      requireAuth: true
    },
    {
      path: '/study',
      name: 'study',
      component: study,
      requireAuth: true
    },
  ]
})
