Browse Source
Merge pull request #376 from xiaoweihong/patch-1
NavigationDuplicated error
main
奇淼(piexlmax
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
8 additions and
1 deletions
-
web/src/router/index.js
|
|
@ -3,6 +3,13 @@ import Router from 'vue-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 = [{ |
|
|
|
path: '/', |
|
|
|
redirect: '/login' |
|
|
|