报错信息:vue-router.esm.js?8c4f:2065 Uncaught (in promise) Error: Redirected when going from "/home/page" to "/home/my" via a navigation guard.
解决方法:在路由表中添加
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);
}
来解决重定向的报错