import Vue from 'vue'
import Router from 'vue-router'

/** 首页 */
import HomePage from './views/home/HomePage'
/** 党组织申请 */
import ApplyFor from './views/home/ApplyFor'
/** 新闻详情 */
import NewsDetails from './views/home/NewsDetails'
/** 新闻列表 */
import NewsList from './views/home/NewsList'
/** 登录 */
import Login from './views/Login'
/** 注册 */
import Registered from './views/Registered'
/** 项目管理 */
import Project from './views/project/Project'
/** 项目进度 */
import Schedule from './views/project/Schedule'
/** 项目创建 */
import Application from './views/project/Application'
/** 个人中心 */
import PersonalZte from './views/personal/PersonalZte'
/** 党组织申请 */
import Apply from './views/personal/Apply'
/** 我的收藏 */
import Collection from './views/personal/Collection'
/** 项目申报 */
import Declare from './views/personal/Declare'
/** 修改密码 */
import Modify from './views/personal/Modify'
/** 信息查询 */
import InformationQuery from './views/InformationQuery'

Vue.use(Router)

export default new Router({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/informationQuery',
      name: 'informationQuery',
      component: InformationQuery
    },
    {
      path: '/modify',
      name: 'modify',
      meta: {
        requireAuth: true
      },
      component: Modify
    },
    {
      path: '/declare',
      name: 'declare',
      meta: {
        requireAuth: true
      },
      component: Declare
    },
    {
      path: '/collection',
      name: 'collection',
      meta: {
        requireAuth: true
      },
      component: Collection
    },
    {
      path: '/apply',
      name: 'apply',
      meta: {
        requireAuth: true
      },
      component: Apply
    },
    {
      path: '/personalZte',
      name: 'personalZte',
      meta: {
        requireAuth: true
      },
      component: PersonalZte
    },
    {
      path: '/application',
      name: 'application',
      meta: {
        requireAuth: true
      },
      component: Application
    },
    {
      path: '/schedule:id',
      name: 'schedule',
      meta: {
        requireAuth: true
      },
      component: Schedule
    },
    {
      path: '/project',
      name: 'project',
      meta: {
        requireAuth: true
      },
      component: Project
    },
    {
      path: '/registered',
      name: 'registered',
      component: Registered
    },
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    {
      path: '/newsList',
      name: 'newsList',
      component: NewsList
    },
    {
      path: '/newsDetails',
      name: 'newsDetails',
      component: NewsDetails
    },
    {
      path: '/applyFor',
      name: 'applyFor',
      meta: {
        requireAuth: true
      },
      component: ApplyFor
    },
    {
      path: '/',
      name: 'homePage',
      component: HomePage
    }
  ]
})
