gtsoft-snail-job-server/frontend/src/router/index.js

18 lines
505 B
JavaScript
Raw Normal View History

2023-01-14 21:02:18 +08:00
import Vue from 'vue'
import Router from 'vue-router'
import { constantRouterMap } from '@/config/router.config'
// hack router push callback
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)
}
Vue.use(Router)
export default new Router({
mode: 'hash',
routes: constantRouterMap
})