vue2项目,设置登录拦截后报错,请问这是什么原因

设置完登录拦截报下面的错

img

img

我在login.vue组件中使用的是this.$router.replace跳转的,换成push跳转也没用

这种方法也不行
const originalPush = VueRouter.prototype.push
VueRouter.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)
}

请问除了降低router版本还有什么方法呀?

router 几?
https://www.jianshu.com/p/38c13e2009d9

https://blog.csdn.net/qq_39704057/article/details/120060000