vue 报 Error: Redirected when going from "/login?redirect=%2Fdashboard" to "/dashboard" via a navigation guard.

 

 

 可在router 中添加

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)
}

随之可以解决

 

posted @ 2021-04-28 14:39  monologuse  阅读(4913)  评论(0编辑  收藏  举报