Redirected when going from "/**" to "/**" via a navigation guard.
原因:重复的重定向引起vue-router报错。。。vue-router replace跳转时引发的错误
解决方法:在配置路由页面做如下调整,亲测有效
//push 2022/3/4
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)
}
// replace 2022/3/4
const originalReplace = Router.prototype.replace
Router.prototype.replace= function replace(location) {
return originalReplace.call(this, location).catch(err => err)
}