1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
const publicPath = require('@/config/isc-publicPath.js')
//const webscan=require("./webscan/index.js").default;
import Vue from 'vue'
import Router from 'vue-router'
import { stringifyQuery, parseQuery } from '~/utils/query'
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
Vue.use(Router)
import login from '../page/login.vue'
import index from '../page/index.vue'
import noLogin from '../page/noLogin.vue'
import singlePage from '../page/singlePage.vue'
import isc_404 from '../page/isc_404.vue'
import business, { docpan } from './business'
export default new Router({
mode:'history',
stringifyQuery, // 序列化query参数
parseQuery, // 反序列化query参数
base: publicPath,
routes: [
docpan,
{
path:'/',
redirect:'/home',
component:index,
name:'index',
children:[
...business,
],
meta:{
auth:'true',
title:'index'
}
},
{
path:'/login',
component:login,
name:'login',
meta:{
title:'登录'
}
},
{
path:'/noLogin',
component:noLogin,
name:'noLogin',
meta:{
title:'未登录或登录超时'
}
},
{
path:'/singlePage',
component: singlePage,
name: 'singlePage',
meta:{
title:'单点登录'
}
},
{
path:'*',
component:index,
children:[
{
path:'/',
component:isc_404,
meta:{
title:'404'
}
}
]
}
]
})