在router下面的index里面重写一遍路由即可
// vue-router重写push方法,解决相同路径跳转报错
const routerPush = Router.prototype.push;
Router.prototype.push = function push(location) {
// 这个语句用来解决报错
// 调用原来的push函数,并捕获异常
return routerPush.call(this, location).catch(err => err);
}