Blame view

ant-design-vue-jeecg/src/router/index.js 546 Bytes
肖超群 authored
1
2
import Vue from 'vue'
import Router from 'vue-router'
肖超群 authored
3
import {constantRouterMap} from '@/config/router.config'
肖超群 authored
4
5
6
7

Vue.use(Router)

export default new Router({
8
  mode: 'hash',
肖超群 authored
9
  base: process.env.BASE_URL,
肖超群 authored
10
  scrollBehavior: () => ({y: 0}),
肖超群 authored
11
  routes: constantRouterMap
12
13
14
15
16
17
18
19
})

const originalPush = Router.prototype.push;
Router.prototype.push = function push(location, onResolve, onReject) {
  if (onResolve || onReject)
    return originalPush.call(this, location, onResolve, onReject);
  return originalPush.call(this, location).catch((err) => err);
};