| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- import Vue from 'vue'
- import Router from 'vue-router'
- import path from '@/router/RoutingPath'
- Vue.use(Router)
- const routerPush = Router.prototype.push
- Router.prototype.push = function push(location,onResolve,onReject) {
- if (onResolve || onReject){
- return routerPush.call(this, location, onResolve, onReject)
- }
- return routerPush.call(this, location).catch(error => error)
- }
- export const constantRouterMap = [
- {
- path: '',
- redirect: "home",
- hidden: true
- },
- {
- path: '/login',
- name: 'login',
- component: path.logins,
- meta: {
- title: '登录',
- },
- hidden: true,
- },
- // {path: '/404', component: path.page404, name: 'page404'},
- {
- name: "error",
- path: "/error",
- hidden: true,
- redirect: "404",
- component: path.layout,
- // alwaysShow: true,
- // meta: { title: "报错", icon: "system", noCache: false },
- children: [
- {
- name: "page404",
- path: "/404",
- hidden: false,
- component: path.page404,
- meta: { title: "404", icon: "user", noCache: false },
- }
- ],
- },
- {
- name: "home",
- path: "/home",
- hidden: false,
- redirect: "home",
- component: path.layout,
- alwaysShow: true,
- meta: { title: "工作台", icon: "system", noCache: false },
- children: [
- {
- name: "home",
- path: "/home",
- hidden: false,
- component: path.home,
- meta: { title: "工作台", icon: "user", noCache: false },
- }
- ],
- },
- ]
- const router = new Router({
- mode: 'history', // 去掉url中的#
- routes: constantRouterMap
- })
- export default router
|