import Vue from 'vue'
import Router from 'vue-router'
import Storage from '@/pages/new/storage'
import Removal from '@/pages/new/removal'
import DeliveryInquiry from '@/pages/new/deliveryInquiry'
import SignA from '@/pages/new/sign'
import Combine from '@/pages/new/combine'
import SureCombine from '@/pages/new/sureCombine'
import Batched from '@/pages/new/batched'
import ScannerResult from '@/pages/new/scannerResult'
import Login from '@/pages/login'
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: '/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: '/Storage',
		name: 'Storage',
		component: Storage,
		meta: {
			needLogin: true //需要加校检判断的路由
		}
	},
	{ //快件出库
		path: '/Removal',
		name: 'Removal',
		component: Removal,
		meta: {
			needLogin: true //需要加校检判断的路由
		}
	},
	{ //派件查询
		path: '/DeliveryInquiry',
		name: 'DeliveryInquiry',
		component: DeliveryInquiry,
		meta: {
			needLogin: true //需要加校检判断的路由
		}
	},
	{ //派件签收
		path: '/SignA',
		name: 'SignA',
		component: SignA,
		meta: {
			needLogin: true //需要加校检判断的路由
		}
	},
	{ //合并签收
		path: '/Combine',
		name: 'Combine',
		component: Combine,
		meta: {
			needLogin: true //需要加校检判断的路由
		}
	},
	{ //确认派件签收
		path: '/SureCombine',
		name: 'SureCombine',
		component: SureCombine,
		meta: {
			needLogin: true //需要加校检判断的路由
		}
	},
	{ //生成批次号
		path: '/Batched',
		name: 'Batched',
		component: Batched,
		meta: {
			needLogin: true //需要加校检判断的路由
		}
	},
	{ //扫描结果页面
		path: '/ScannerResult',
		name: 'ScannerResult',
		component: ScannerResult,
		meta: {
			needLogin: true //需要加校检判断的路由
		}
	},]
})
