Uncaught (in promise) Error: Redirected when going from “/login?redirect=%2Fdashboard“ to “/dashboar
vue项目报错:Uncaught (in promise) Error: Redirected when going from “/login?redirect=%2Fdashboard” to “/dashboard” via a navigation guard.解决办法在router文件下的index.js中添加下面的代码const originalPush = Router.prototy
·
vue项目报错:
Uncaught (in promise) Error: Redirected when going from “/login?redirect=%2Fdashboard” to “/dashboard” via a navigation guard.
解决办法
在router文件下的index.js中添加下面的代码
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);
};
如果本文对你有帮助,请点个赞吧!
更多推荐
已为社区贡献3条内容
所有评论(0)