vue router模式改成history页面刷新404问题

在配置文件添加

  "/": {
    target: "http://localhost:3000",
    bypass: function(req, res, proxyOptions) {
      if (req.headers.accept.indexOf("html") !== -1) {
        console.log("Skipping proxy for browser request.");
        return "/index.html";
      }
    }
  }
}
posted @ 2020-04-23 17:30  不服憋着  阅读(766)  评论(0编辑  收藏  举报