
import luxianxinxi from '@/views/modules/luxianxinxi/list'
import Vue from 'vue';
//配置路由
import VueRouter from 'vue-router'
Vue.use(VueRouter);
//1.创建组件
import Index from '@/views/index'
import Home from '@/views/home'
import Login from '@/views/login'
import NotFound from '@/views/404'
import UpdatePassword from '@/views/update-password'
import pay from '@/views/pay'
import register from '@/views/register'
import center from '@/views/center'
    import cheliangdangan from '@/views/modules/cheliangdangan/list'
    import xubaotongzhi from '@/views/modules/xubaotongzhi/list'
    import gongzuorenyuan from '@/views/modules/gongzuorenyuan/list'
    import shigujilu from '@/views/modules/shigujilu/list'
    import guapaishenqing from '@/views/modules/guapaishenqing/list'
    import jiashiyuan from '@/views/modules/jiashiyuan/list'
    import gonggaoxinxi from '@/views/modules/gonggaoxinxi/list'
    import fafangpaizhao from '@/views/modules/fafangpaizhao/list'
    import baoxianxinxi from '@/views/modules/baoxianxinxi/list'


//2.配置路由   注意：名字
export const routes = [{
    path: '/',
    name: '系统首页',
    component: Index,
    children: [{
      // 这里不设置值，是把main作为默认页面
      path: '/',
      name: '系统首页',
      component: Home,
      meta: {icon:'', title:'center', affix: true}
    }, {
      path: '/updatePassword',
      name: '修改密码',
      component: UpdatePassword,
      meta: {icon:'', title:'updatePassword'}
    }, {
      path: '/pay',
      name: '支付',
      component: pay,
      meta: {icon:'', title:'pay'}
    }, {
      path: '/center',
      name: '个人信息',
      component: center,
      meta: {icon:'', title:'center'}
    }
      
        ,{
            path: '/luxianxinxi',
            name: '路线信息',
            component: luxianxinxi
        }
,{
	path: '/cheliangdangan',
        name: '车辆档案',
        component: cheliangdangan
      }
      ,{
	path: '/xubaotongzhi',
        name: '续保通知',
        component: xubaotongzhi
      }
      ,{
	path: '/gongzuorenyuan',
        name: '工作人员',
        component: gongzuorenyuan
      }
      ,{
	path: '/shigujilu',
        name: '事故记录',
        component: shigujilu
      }
      ,{
	path: '/guapaishenqing',
        name: '挂牌申请',
        component: guapaishenqing
      }
      ,{
	path: '/jiashiyuan',
        name: '驾驶员',
        component: jiashiyuan
      }
      ,{
	path: '/gonggaoxinxi',
        name: '公告信息',
        component: gonggaoxinxi
      }
      ,{
	path: '/fafangpaizhao',
        name: '发放牌照',
        component: fafangpaizhao
      }
      ,{
	path: '/baoxianxinxi',
        name: '保险信息',
        component: baoxianxinxi
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: Login,
    meta: {icon:'', title:'login'}
  },
  {
    path: '/register',
    name: 'register',
    component: register,
    meta: {icon:'', title:'register'}
  },
  {
    path: '*',
    component: NotFound
  }
]
//3.实例化VueRouter  注意：名字
const router = new VueRouter({
  mode: 'hash',
  /*hash模式改为history*/
  routes // （缩写）相当于 routes: routes
})
const originalPush = VueRouter.prototype.push
//修改原型对象中的push方法
VueRouter.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}
export default router;
