論壇進入user頁中時驾凶,會跳入到localhost:8080/user/user/{id}中,解決辦法:
import vueRouter from 'vue-router'
const originalPush = vueRouter.prototype.push;
vueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err);
}
vueRouter為自定義的名字