const originalPush = Router.prototype.push;
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch((err) => err);
};
以上三行代码是防止用户重复点击相同路由报错的拦截请求
const originalPush = Router.prototype.push;
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch((err) => err);
};
以上三行代码是防止用户重复点击相同路由报错的拦截请求