import Vue from 'vue'
import Router from 'vue-router'
import Kjsearch from '@/pages/kjsearch'
import Sysearch from '@/pages/sysearch'
import Kjsearchinfo from '@/pages/kjsearchinfo'
import Jjsearch from '@/pages/jjsearch'
import Sjdj from '@/pages/sjdj'
import Storage from '@/pages/new/storage'
import Removal from '@/pages/new/removal'
import Addper from '@/pages/addper'
import Box from '@/pages/box'
import Pjpc from '@/pages/pjpc'
import Sign from '@/pages/sign'
import Sign2 from '@/pages/sign2'
import Login from '@/pages/login'
import Key from '@/pages/key'
import My from '@/pages/my'
import Personinfomation from '@/pages/personinfomation'
import Forgetpassword from '@/pages/forgetpassword'
// 用户使用
import Email from '@/pages/email'
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)
}
Vue.use(Router)

export default new Router({
	routes: [{ //登录
			path: '/Login',
			name: 'Login',
			component: Login
		},
		{ //密钥
			path: '/Key',
			name: 'Key',
			component: Key,
			meta: {
				needLogin: true //需要加校检判断的路由
			}
			},
		{ //邮件收发室
			path: '/Sign',
			name: 'Sign',
			component: Sign,
			meta: {
				needLogin: true //需要加校检判断的路由
			}
		},
    { //邮件收发室
    	path: '/Sign2',
    	name: 'Sign2',
    	component: Sign2,
    	meta: {
    		needLogin: true //需要加校检判断的路由
    	}
    },
    { //我的
    	path: '/My',
    	name: 'My',
    	component: My,
    	meta: {
    		needLogin: true //需要加校检判断的路由
    	}
    },
    { //个人信息
    	path: '/Personinfomation',
    	name: 'Personinfomation',
    	component: Personinfomation,
    	meta: {
    		needLogin: true //需要加校检判断的路由
    	}
    },
    { //修改密码
    	path: '/Forgetpassword',
    	name: 'Forgetpassword',
    	component: Forgetpassword,
    	meta: {
    		needLogin: true //需要加校检判断的路由
    	}
    },
		{ //邮件收发室
			path: '/',
			name: 'Email',
			component: Email,
			meta: {
				needLogin: true //需要加校检判断的路由
			}
		},
		{ //快件查询
			path: '/Kjsearch',
			name: 'Kjsearch',
			component: Kjsearch,
			meta: {
				needLogin: true //需要加校检判断的路由
			}
		},
    { //首页查询
    	path: '/Sysearch',
    	name: 'Sysearch',
    	component: Sysearch,
    	meta: {
    		needLogin: true //需要加校检判断的路由
    	}
    },
		{ //快件查询详情
			path: '/Kjsearchinfo',
			name: 'Kjsearchinfo',
			component: Kjsearchinfo,
			meta: {
				needLogin: true //需要加校检判断的路由
			}
		},
		{ //寄件查询
			path: '/Jjsearch',
			name: 'Jjsearch',
			component: Jjsearch,
			meta: {
				needLogin: true //需要加校检判断的路由
			}
		},
		{ //收件登记
			path: '/Sjdj',
			name: 'Sjdj',
			component: Sjdj,
			meta: {
				needLogin: true //需要加校检判断的路由
			}
		},
		{ //快件入库
			path: '/Storage',
			name: 'Storage',
			component: Storage,
			meta: {
				needLogin: true //需要加校检判断的路由
			}
		},
		{ //快件出库
			path: '/Removal',
			name: 'Removal',
			component: Removal,
			meta: {
				needLogin: true //需要加校检判断的路由
			}
		},
		{ //新增收件人
			path: '/Addper',
			name: 'Addper',
			component: Addper,
			meta: {
				needLogin: true //需要加校检判断的路由
			}
		},
		{ //柜子
			path: '/Box',
			name: 'Box',
			component: Box,
			meta: {
				needLogin: true //需要加校检判断的路由
			}
		},
		{ //派件批次
			path: '/Pjpc',
			name: 'Pjpc',
			component: Pjpc,
			meta: {
				needLogin: true //需要加校检判断的路由
			}
		},
	]
})
