import Vue from 'vue'
import VueRouter from 'vue-router'
import { routes } from './router.config'

Vue.use(VueRouter)

const router = new VueRouter({
    base: process.env.BASE_URL,
    routes
})

const origin_push = VueRouter.prototype.push
VueRouter.prototype.push = function (location) {
    return origin_push.call(this, location).catch(e => e)
}

export default router