这个报错是重复路由引起的。
在 route 文件夹下的 index.js 中修改
需要给VueRouter里面自己重写 push 和 replace 方法
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
const originalReplace = VueRouter.prototype.replace;
VueRouter.prototype.replace = function replace(location) {
return originalReplace.call(this, location).catch(err => err);
};