import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/pages/index'
import Search from '@/pages/search'
import My from '@/pages/my'
import Personinfomation from '@/pages/personinfomation'
import Express from '@/pages/express'
import Inexpress from '@/pages/inexpress'
import Cityexpress from '@/pages/cityexpress'
import Addressbook from '@/pages/addressbook'
import MultipleAddressbook from '@/pages/multipleaddressbook'
import CityAddressbook from '@/pages/cityaddressbook'
import Inaddressbook from '@/pages/inaddressbook'
import Myaddressbook from '@/pages/myaddressbook'
import Newaddress from '@/pages/newaddress'
import InNewaddress from '@/pages/innewaddress'
import Editaddress from '@/pages/editaddress'
import Multipleexpress from '@/pages/multipleexpress'
import Xz from '@/pages/xz'
import Daishou from '@/pages/daishou'
import Info from '@/pages/info'
import MailInfo from '@/pages/mailInfo'
import ExpressExpress from '@/pages/expressExpress'
import Time from '@/pages/time'
import Myexpress from '@/pages/myexpress'

// 新增
import Logisticslist from '@/pages/logisticslist'
import Setting from '@/pages/setting'
import Forgetpassword from '@/pages/forgetpassword'
import Foreignaddress from '@/pages/foreignaddress'
import Foreignexpress from '@/pages/foreignexpress'
import Sbxx from '@/pages/sbxx'
import Hkaddress from '@/pages/hkaddress'
import Hkexpress from '@/pages/hkexpress'
import Sytk from '@/pages/sytk'
import Suggest from '@/pages/suggest'
import SuggestList from '@/pages/suggestList'
import SuggestInfo from '@/pages/suggestInfo'
import Key from '@/pages/key'
import Login from '@/pages/login'


// 202412
import transferGoods from '@/pages/goodsChange/transferGoods'
import storeAdressBook from '@/pages/goodsChange/storeAdressBook'

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: '/',
    name: 'Index',
    component: Index,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { // 门店调货
    path: '/transferGoods',
    name: 'TransferGoods',
    component: transferGoods,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { // 门店地址簿
    path: '/storeAdressBook',
    name: 'StoreAdressBook',
    component: storeAdressBook,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //意见建议列表
    path: '/SuggestList',
    name: 'SuggestList',
    component: SuggestList,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //意见建议详情
    path: '/SuggestInfo',
    name: 'SuggestInfo',
    component: SuggestInfo,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //查件
    path: '/Search',
    name: 'Search',
    component: Search,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  {
    path: '/My',
    name: 'My',
    component: My,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //个人信息
    path: '/Personinfomation',
    name: 'Personinfomation',
    component: Personinfomation,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  {
    path: '/Express',
    name: 'Express',
    component: Express,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //内部件
    path: '/Inexpress',
    name: 'Inexpress',
    component: Inexpress,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //同城急送
    path: '/Cityexpress',
    name: 'Cityexpress',
    component: Cityexpress,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //地址簿
    path: '/Addressbook',
    name: 'Addressbook',
    component: Addressbook,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //地址簿
    path: '/MultipleAddressbook',
    name: 'MultipleAddressbook',
    component: MultipleAddressbook,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //地址簿
    path: '/CityAddressbook',
    name: 'CityAddressbook',
    component: CityAddressbook,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //地址簿
    path: '/Inaddressbook',
    name: 'Inaddressbook',
    component: Inaddressbook,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //我的地址簿
    path: '/Myaddressbook',
    name: 'Myaddressbook',
    component: Myaddressbook,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //新建地址
    path: '/Newaddress',
    name: 'Newaddress',
    component: Newaddress,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //新建地址(内部)
    path: '/InNewaddress',
    name: 'InNewaddress',
    component: InNewaddress,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //编辑地址
    path: '/Editaddress',
    name: 'Editaddress',
    component: Editaddress,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //批量寄
    path: '/Multipleexpress',
    name: 'Multipleexpress',
    component: Multipleexpress,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //禁寄品须知
    path: '/Xz',
    name: 'Xz',
    component: Xz,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //快递代收
    path: '/Daishou',
    name: 'Daishou',
    component: Daishou,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //查快递
    path: '/Info',
    name: 'Info',
    component: Info,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //内部外部详情
    path: '/MailInfo',
    name: 'MailInfo',
    component: MailInfo,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //我的收件详情
    path: '/ExpressExpress',
    name: 'ExpressExpress',
    component: ExpressExpress,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //运费时效
    path: '/Time',
    name: 'Time',
    component: Time,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //我的快件
    path: '/Myexpress',
    name: 'Myexpress',
    component: Myexpress,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  // 新增
  { //设置
    path: '/Setting',
    name: 'Setting',
    component: Setting,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //使用条款
    path: '/Sytk',
    name: 'Sytk',
    component: Sytk,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //意见建议
    path: '/Suggest',
    name: 'Suggest',
    component: Suggest,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //忘记密码
    path: '/Forgetpassword',
    name: 'Forgetpassword',
    component: Forgetpassword
  },
  { //添加国际收件人
    path: '/foreignaddress',
    name: 'foreignaddress',
    component: Foreignaddress,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //国际寄件
    path: '/Foreignexpress',
    name: 'Foreignexpress',
    component: Foreignexpress,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //申报信息
    path: '/Sbxx',
    name: 'Sbxx',
    component: Sbxx,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //添加港澳收件人
    path: '/Hkaddress',
    name: 'Hkaddress',
    component: Hkaddress,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //添加港澳
    path: '/Hkexpress',
    name: 'Hkexpress',
    component: Hkexpress,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //添加港澳
    path: '/Key',
    name: 'Key',
    component: Key,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //运单追踪
    path: '/Logisticslist',
    name: 'Logisticslist',
    component: Logisticslist,
    meta: {
      needLogin: true //需要加校检判断的路由
    }
  },
  { //登录
    path: '/Login',
    name: 'Login',
    component: Login
  },
  ]
})
