未验证 提交 2f6eb83c 编写于 作者: X xiaowei 提交者: GitHub
上级 6a0a763a
...@@ -3,6 +3,13 @@ import Router from 'vue-router' ...@@ -3,6 +3,13 @@ import Router from 'vue-router'
Vue.use(Router) Vue.use(Router)
//获取原型对象上的push函数
const originalPush = Router.prototype.push
//修改原型对象中的push方法
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
const baseRouters = [{ const baseRouters = [{
path: '/', path: '/',
redirect: '/login' redirect: '/login'
...@@ -23,4 +30,4 @@ const createRouter = () => new Router({ ...@@ -23,4 +30,4 @@ const createRouter = () => new Router({
const router = createRouter() const router = createRouter()
export default router export default router
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册