|
@@ -1,151 +1,154 @@
|
|
|
-import Vue from 'vue';
|
|
|
-import Router from 'vue-router';
|
|
|
+import Vue from 'vue'
|
|
|
+import Router from 'vue-router'
|
|
|
|
|
|
-import { Message } from 'element-ui';
|
|
|
+import { Message } from 'element-ui'
|
|
|
|
|
|
-const Login = () => import('@/views/Login');
|
|
|
-const Home = () => import('@/views/Home');
|
|
|
+const Login = () => { return import(`@/views/Login`) }
|
|
|
+const Home = () => { return import(`@/views/Home`) }
|
|
|
// 首页
|
|
|
-const Main = () => import('@/views/main/main');
|
|
|
+const Main = () => { return import(`@/views/main/main`) }
|
|
|
|
|
|
// 个人中心
|
|
|
-const Personal = () => import('@/views/personal/personal');
|
|
|
+const Personal = () => { return import(`@/views/personal/personal`) }
|
|
|
|
|
|
// 充值记录
|
|
|
-const customerRechargeMoney = () => import('@/views/customerRechargeMoney/customerRechargeMoney');
|
|
|
+const customerRechargeMoney = () => { return import(`@/views/customerRechargeMoney/customerRechargeMoney`) }
|
|
|
|
|
|
// 个人中心
|
|
|
-const Customer = () => import('@/views/customer/Customer');
|
|
|
-const CustomerRecharge = () => import('@/views/customer/customerRecharge');
|
|
|
-const custRecTime = () => import('@/views/customer/custRecTime');
|
|
|
-const custRecMoney = () => import('@/views/customer/custRecMoney');
|
|
|
+const Customer = () => { return import(`@/views/customer/Customer`) }
|
|
|
+const CustomerRecharge = () => { return import(`@/views/customer/customerRecharge`) }
|
|
|
+const custRecTime = () => { return import(`@/views/customer/custRecTime`) }
|
|
|
+const custRecMoney = () => { return import(`@/views/customer/custRecMoney`) }
|
|
|
|
|
|
-const customerEtcChangeInfo = () => import('@/views/customer/customerEtcChangeInfo');
|
|
|
+const customerEtcChangeInfo = () => { return import(`@/views/customer/customerEtcChangeInfo`) }
|
|
|
|
|
|
// 系统管理部分
|
|
|
-const User = () => import('@/views/sys/user');
|
|
|
+const User = () => { return import(`@/views/sys/user`) }
|
|
|
|
|
|
// 无车部分
|
|
|
-const nocarRec = () => import('@/views/noCar/nocarRec.vue');
|
|
|
-const billway = () => import('@/views/noCar/billway.vue');
|
|
|
-const nocarInvoice = () => import('@/views/noCar/invoice.vue');
|
|
|
-const billwayException = () => import('@/views/noCar/billwayException.vue');
|
|
|
-const noCarCalculateInfo = () => import('@/views/noCar/calculateInfo.vue');
|
|
|
-const noCarCalculateInfoStatis = () => import('@/views/noCar/calculateInfostatis.vue');
|
|
|
-const hcInvoice = () => import('@/views/noCar/hcInvoice.vue');
|
|
|
-const mothaccount = () => import('@/views/noCar/mothaccount.vue');
|
|
|
+const nocarRec = () => { return import(`@/views/noCar/nocarRec.vue`) }
|
|
|
+const billway = () => { return import(`@/views/noCar/billway.vue`) }
|
|
|
+const nocarInvoice = () => { return import(`@/views/noCar/invoice.vue`) }
|
|
|
+const billwayException = () => { return import(`@/views/noCar/billwayException.vue`) }
|
|
|
+const noCarCalculateInfo = () => { return import(`@/views/noCar/calculateInfo.vue`) }
|
|
|
+const noCarCalculateInfoStatis = () => { return import(`@/views/noCar/calculateInfostatis.vue`) }
|
|
|
+const hcInvoice = () => { return import(`@/views/noCar/hcInvoice.vue`) }
|
|
|
+const mothaccount = () => { return import(`@/views/noCar/mothaccount.vue`) }
|
|
|
// 自有车部分
|
|
|
|
|
|
-const selfcarRec = () => import('@/views/selfCar/selfcarRec.vue');
|
|
|
-const selfCarTrade = () => import('@/views/selfCar/selfCarTrade.vue');
|
|
|
-const selfInvoice = () => import('@/views/selfCar/invoice.vue');
|
|
|
-const selfCarTradeException = () => import('@/views/selfCar/selfCarTradeException.vue');
|
|
|
-const SelfCalculateInfo = () => import('@/views/selfCar/calculateInfo.vue');
|
|
|
-const selfCarApply = () => import('@/views/selfCar/selfCarApply');
|
|
|
+const selfcarRec = () => { return import(`@/views/selfCar/selfcarRec.vue`) }
|
|
|
+const selfCarTrade = () => { return import(`@/views/selfCar/selfCarTrade.vue`) }
|
|
|
+const selfInvoice = () => { return import(`@/views/selfCar/invoice.vue`) }
|
|
|
+const selfCarTradeException = () => { return import(`@/views/selfCar/selfCarTradeException.vue`) }
|
|
|
+const SelfCalculateInfo = () => { return import(`@/views/selfCar/calculateInfo.vue`) }
|
|
|
+const selfCarApply = () => { return import(`@/views/selfCar/selfCarApply`) }
|
|
|
+const tradeCarApply = () => { return import(`@/views/selfCar/tradeCarApply`) }
|
|
|
+
|
|
|
// 平台菜单部分
|
|
|
|
|
|
// 发票管理部分(企业注册部分)
|
|
|
-const Check = () => import('@/views/platform/check/check');
|
|
|
+const Check = () => { return import(`@/views/platform/check/check`) }
|
|
|
// 自有车
|
|
|
-const Apply = () => import('@/views/platform/apply/apply');
|
|
|
-const Already = () => import('@/views/platform/apply/already');
|
|
|
-const Packaging = () => import('@/views/platform/apply/packaging');
|
|
|
-const selfCarTradeP = () => import('@/views/platform/apply/selfCarTrade');
|
|
|
+const Apply = () => { return import(`@/views/platform/apply/apply`) }
|
|
|
+const Already = () => { return import(`@/views/platform/apply/already`) }
|
|
|
+const Packaging = () => { return import(`@/views/platform/apply/packaging`) }
|
|
|
+const selfCarTradeP = () => { return import(`@/views/platform/apply/selfCarTrade`) }
|
|
|
|
|
|
-const Carbinding = () => import('@/views/platform/carbinding/carbinding');
|
|
|
-const Carbindinglist = () => import('@/views/platform/carbinding/carbindinglist');
|
|
|
+const Carbinding = () => { return import(`@/views/platform/carbinding/carbinding`) }
|
|
|
+const Carbindinglist = () => { return import(`@/views/platform/carbinding/carbindinglist`) }
|
|
|
|
|
|
-const Carupload = () => import('@/views/platform/car/carupload');
|
|
|
-const Carsuccess = () => import('@/views/platform/car/carsuccess');
|
|
|
+const Carupload = () => { return import(`@/views/platform/car/carupload`) }
|
|
|
+const Carsuccess = () => { return import(`@/views/platform/car/carsuccess`) }
|
|
|
|
|
|
-const Waybill = () => import('@/views/platform/waybill/waybill');
|
|
|
-const Over = () => import('@/views/platform/waybill/over');
|
|
|
-const History = () => import('@/views/platform/waybill/history');
|
|
|
+const Waybill = () => { return import(`@/views/platform/waybill/waybill`) }
|
|
|
+const Over = () => { return import(`@/views/platform/waybill/over`) }
|
|
|
+const History = () => { return import(`@/views/platform/waybill/history`) }
|
|
|
|
|
|
-const WaybillList = () => import('@/views/platform/waybillmanagement/waybillList');
|
|
|
-const Noinvoice = () => import('@/views/platform/waybillmanagement/noinvoice');
|
|
|
-const Trueinvoice = () => import('@/views/platform/waybillmanagement/trueinvoice');
|
|
|
+const WaybillList = () => { return import(`@/views/platform/waybillmanagement/waybillList`) }
|
|
|
+const Noinvoice = () => { return import(`@/views/platform/waybillmanagement/noinvoice`) }
|
|
|
+const Trueinvoice = () => { return import(`@/views/platform/waybillmanagement/trueinvoice`) }
|
|
|
|
|
|
-const Invoice = () => import('@/views/platform/invoice/invoice');
|
|
|
-const List = () => import('@/views/platform/invoice/list');
|
|
|
+const Invoice = () => { return import(`@/views/platform/invoice/invoice`) }
|
|
|
+const List = () => { return import(`@/views/platform/invoice/list`) }
|
|
|
// 参数管理
|
|
|
-const paramMagager = () => import('@/views/manager/paramMagager.vue');
|
|
|
+const paramMagager = () => { return import(`@/views/manager/paramMagager.vue`) }
|
|
|
|
|
|
-Vue.use(Router);
|
|
|
+Vue.use(Router)
|
|
|
|
|
|
const router = new Router({
|
|
|
- base: '/jkcredit/',
|
|
|
- mode: 'history',
|
|
|
+ base: `/jkcredit/`,
|
|
|
+ mode: `history`,
|
|
|
routes: [
|
|
|
- { name: 'Login', path: '/login', component: Login },
|
|
|
+ { name: `Login`, path: `/login`, component: Login },
|
|
|
{
|
|
|
- name: 'Home',
|
|
|
- path: '/',
|
|
|
+ name: `Home`,
|
|
|
+ path: `/`,
|
|
|
component: Home,
|
|
|
- redirect: '/main',
|
|
|
+ redirect: `/main`,
|
|
|
children: [
|
|
|
// 首页
|
|
|
- { name: 'Main', path: '/main', component: Main },
|
|
|
+ { name: `Main`, path: `/main`, component: Main },
|
|
|
// 个人中心
|
|
|
- { name: 'Personal', path: '/personal', component: Personal },
|
|
|
+ { name: `Personal`, path: `/personal`, component: Personal },
|
|
|
// 充值记录
|
|
|
- { name: 'customerRechargeMoney', path: '/customerRechargeMoney', component: customerRechargeMoney },
|
|
|
+ { name: `customerRechargeMoney`, path: `/customerRechargeMoney`, component: customerRechargeMoney },
|
|
|
|
|
|
// 客户管理
|
|
|
- { name: 'Customer', path: '/customer', component: Customer },
|
|
|
- { name: 'customerRecharge', path: '/CustomerRecharge', component: CustomerRecharge },
|
|
|
- { name: 'custRecTime', path: '/custRecTime', component: custRecTime },
|
|
|
- { name: 'custRecMoney', path: '/custRecMoney', component: custRecMoney },
|
|
|
- { name: 'customerEtcChangeInfo', path: '/customerEtcChangeInfo', component: customerEtcChangeInfo },
|
|
|
- { name: 'selfCarApply', path: '/selfCarApply', component: selfCarApply },
|
|
|
+ { name: `Customer`, path: `/customer`, component: Customer },
|
|
|
+ { name: `customerRecharge`, path: `/CustomerRecharge`, component: CustomerRecharge },
|
|
|
+ { name: `custRecTime`, path: `/custRecTime`, component: custRecTime },
|
|
|
+ { name: `custRecMoney`, path: `/custRecMoney`, component: custRecMoney },
|
|
|
+ { name: `customerEtcChangeInfo`, path: `/customerEtcChangeInfo`, component: customerEtcChangeInfo },
|
|
|
+ { name: `selfCarApply`, path: `/selfCarApply`, component: selfCarApply },
|
|
|
+ { name: `tradeCarApply`, path: `/tradeCarApply`, component: tradeCarApply },
|
|
|
// 系统管理部分
|
|
|
- { name: 'User', path: '/user', component: User },
|
|
|
+ { name: `User`, path: `/user`, component: User },
|
|
|
// 无车部分
|
|
|
- { name: 'nocarRec', path: '/nocarRec', component: nocarRec },
|
|
|
- { name: 'billway', path: '/billway', component: billway },
|
|
|
- { name: 'nocarInvoice', path: '/nocarInvoice', component: nocarInvoice },
|
|
|
- { name: 'billwayException', path: '/billwayException', component: billwayException },
|
|
|
- { name: 'noCarCalculateInfo', path: '/noCarCalculateInfo', component: noCarCalculateInfo },
|
|
|
- { name: 'noCarCalculateInfoStatis', path: '/noCarCalculateInfoStatis', component: noCarCalculateInfoStatis },
|
|
|
-
|
|
|
- { name: 'hcInvoice', path: '/hcInvoice', component: hcInvoice },
|
|
|
- { name: 'mothaccount', path: '/mothaccount', component: mothaccount },
|
|
|
+ { name: `nocarRec`, path: `/nocarRec`, component: nocarRec },
|
|
|
+ { name: `billway`, path: `/billway`, component: billway },
|
|
|
+ { name: `nocarInvoice`, path: `/nocarInvoice`, component: nocarInvoice },
|
|
|
+ { name: `billwayException`, path: `/billwayException`, component: billwayException },
|
|
|
+ { name: `noCarCalculateInfo`, path: `/noCarCalculateInfo`, component: noCarCalculateInfo },
|
|
|
+ { name: `noCarCalculateInfoStatis`, path: `/noCarCalculateInfoStatis`, component: noCarCalculateInfoStatis },
|
|
|
+
|
|
|
+ { name: `hcInvoice`, path: `/hcInvoice`, component: hcInvoice },
|
|
|
+ { name: `mothaccount`, path: `/mothaccount`, component: mothaccount },
|
|
|
// 自有车部分
|
|
|
- { name: 'selfcarRec', path: '/selfcarRec', component: selfcarRec },
|
|
|
- { name: 'selfInvoice', path: '/selfInvoice', component: selfInvoice },
|
|
|
- { name: 'selfCarTrade', path: '/selfCarTrade', component: selfCarTrade },
|
|
|
- { name: 'selfCarTradeException', path: '/selfCarTradeException', component: selfCarTradeException },
|
|
|
- { name: 'SelfCalculateInfo', path: '/SelfCalculateInfo', component: SelfCalculateInfo },
|
|
|
+ { name: `selfcarRec`, path: `/selfcarRec`, component: selfcarRec },
|
|
|
+ { name: `selfInvoice`, path: `/selfInvoice`, component: selfInvoice },
|
|
|
+ { name: `selfCarTrade`, path: `/selfCarTrade`, component: selfCarTrade },
|
|
|
+ { name: `selfCarTradeException`, path: `/selfCarTradeException`, component: selfCarTradeException },
|
|
|
+ { name: `SelfCalculateInfo`, path: `/SelfCalculateInfo`, component: SelfCalculateInfo },
|
|
|
|
|
|
// 平台菜单部分
|
|
|
- { name: 'Check', path: '/check', component: Check },
|
|
|
+ { name: `Check`, path: `/check`, component: Check },
|
|
|
|
|
|
- { name: 'Apply', path: '/apply', component: Apply },
|
|
|
- { name: 'Already', path: '/already', component: Already },
|
|
|
- { name: 'Packaging', path: '/packaging', component: Packaging },
|
|
|
- { name: 'selfCarTradeP', path: '/selfCarTradeP', component: selfCarTradeP },
|
|
|
- { name: 'Carbinding', path: '/carbinding', component: Carbinding },
|
|
|
- { name: 'Carbindinglist', path: '/carbindinglist', component: Carbindinglist },
|
|
|
+ { name: `Apply`, path: `/apply`, component: Apply },
|
|
|
+ { name: `Already`, path: `/already`, component: Already },
|
|
|
+ { name: `Packaging`, path: `/packaging`, component: Packaging },
|
|
|
+ { name: `selfCarTradeP`, path: `/selfCarTradeP`, component: selfCarTradeP },
|
|
|
+ { name: `Carbinding`, path: `/carbinding`, component: Carbinding },
|
|
|
+ { name: `Carbindinglist`, path: `/carbindinglist`, component: Carbindinglist },
|
|
|
|
|
|
- { name: 'Carupload', path: '/carupload', component: Carupload },
|
|
|
- { name: 'Carsuccess', path: '/carsuccess', component: Carsuccess },
|
|
|
+ { name: `Carupload`, path: `/carupload`, component: Carupload },
|
|
|
+ { name: `Carsuccess`, path: `/carsuccess`, component: Carsuccess },
|
|
|
|
|
|
- { name: 'Waybill', path: '/waybill', component: Waybill },
|
|
|
- { name: 'Over', path: '/over', component: Over },
|
|
|
- { name: 'History', path: '/history', component: History },
|
|
|
+ { name: `Waybill`, path: `/waybill`, component: Waybill },
|
|
|
+ { name: `Over`, path: `/over`, component: Over },
|
|
|
+ { name: `History`, path: `/history`, component: History },
|
|
|
|
|
|
- { name: 'WaybillList', path: '/waybillList', component: WaybillList },
|
|
|
- { name: 'Noinvoice', path: '/noinvoice', component: Noinvoice },
|
|
|
- { name: 'Trueinvoice', path: '/trueinvoice', component: Trueinvoice },
|
|
|
+ { name: `WaybillList`, path: `/waybillList`, component: WaybillList },
|
|
|
+ { name: `Noinvoice`, path: `/noinvoice`, component: Noinvoice },
|
|
|
+ { name: `Trueinvoice`, path: `/trueinvoice`, component: Trueinvoice },
|
|
|
|
|
|
- { name: 'Invoice', path: '/invoice', component: Invoice },
|
|
|
- { name: 'List', path: '/list', component: List },
|
|
|
+ { name: `Invoice`, path: `/invoice`, component: Invoice },
|
|
|
+ { name: `List`, path: `/list`, component: List },
|
|
|
// 参数管理
|
|
|
- { name: 'paramMagager', path: '/paramMagager', component: paramMagager }
|
|
|
+ { name: `paramMagager`, path: `/paramMagager`, component: paramMagager }
|
|
|
]
|
|
|
}
|
|
|
]
|
|
|
-});
|
|
|
+})
|
|
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
|
// console.log(to);
|
|
@@ -153,20 +156,20 @@ router.beforeEach((to, from, next) => {
|
|
|
// next();
|
|
|
// 如果是登录的时候不判断token ,不是登录才判断token
|
|
|
// console.log(to);
|
|
|
- if (to.name && to.name.toLocaleLowerCase() !== 'login') {
|
|
|
+ if (to.name && to.name.toLocaleLowerCase() !== `login`) {
|
|
|
// 判断token
|
|
|
- const token = sessionStorage.getItem('token');
|
|
|
+ const token = sessionStorage.getItem(`token`)
|
|
|
if (!token) {
|
|
|
// 没有token,跳转到登录页面
|
|
|
// this.$router.push('/login')
|
|
|
- router.push('/login');
|
|
|
+ router.push(`/login`)
|
|
|
// 提示
|
|
|
// this.$message.warning('请先登录');
|
|
|
- Message.warning('请先登录');
|
|
|
- return;
|
|
|
+ Message.warning(`请先登录`)
|
|
|
+ return
|
|
|
}
|
|
|
}
|
|
|
- next();
|
|
|
-});
|
|
|
+ next()
|
|
|
+})
|
|
|
|
|
|
-export default router;
|
|
|
+export default router
|