1.添加配置文件

配置文件中的数据和 application.yml 中的 context-path 保持一致

2.添加配置代码

<script type="text/javascript">
  document.write("<script src='./static/config.js?v=" + new Date().getTime() + "'><\/script>");
</script>

3.修改代码

把代码中用到 process.env.VUE_APP_BASE_API 的地方全部替换成 window.ipConfigUrl.baseURL

Logo

快速构建 Web 应用程序

更多推荐