We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 74a92b0 + c410125 commit fb570acCopy full SHA for fb570ac
web/src/router/index.js
@@ -3,6 +3,13 @@ import Router from 'vue-router'
3
4
Vue.use(Router)
5
6
+//获取原型对象上的push函数
7
+const originalPush = Router.prototype.push
8
+//修改原型对象中的push方法
9
+Router.prototype.push = function push(location) {
10
+ return originalPush.call(this, location).catch(err => err)
11
+}
12
+
13
const baseRouters = [{
14
path: '/',
15
redirect: '/login'
@@ -23,4 +30,4 @@ const createRouter = () => new Router({
23
30
24
31
const router = createRouter()
25
32
26
-export default router
33
+export default router
0 commit comments