// 处理token验证失败,自动登录登录失败,多次重定向到 /loginc 报错问题处理
const originalPush = VueRouter.prototype.push
// 重写了原型上的push方法,统一的处理了错误信息
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
// 处理token验证失败,自动登录登录失败,多次重定向到 /loginc 报错问题处理
const originalPush = VueRouter.prototype.push
// 重写了原型上的push方法,统一的处理了错误信息
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
本文标题:【vue router】多次重定向到一个路由报错问题处理
本文链接:https://www.haomeiwen.com/subject/utuksrtx.html
网友评论