index.js 1.24 KB
Newer Older
fukai committed
1 2 3 4
const publicPath = require('@/config/isc-publicPath.js')
//const webscan=require("./webscan/index.js").default;
import Vue from 'vue'
import Router from 'vue-router'
5
import { stringifyQuery, parseQuery } from '~/utils/query'
fukai committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

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 isc_404 from  '../page/isc_404.vue'

import business, { docpan }  from './business'

export default new Router({
mode:'history',
22 23
stringifyQuery, // 序列化query参数
parseQuery, // 反序列化query参数
fukai committed
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
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:'*',
		component:index,
		children:[
			{
				path:'/',
				component:isc_404,
				meta:{
					title:'404'
				}
			}
		]
	}
]
 })