1、在static文件夹新建一个config.js
window.global_config = {
BASE_URL: "http://127.0.0.1:8821"
};
2 、在index.html文件里引入config.js
<script src="./static/config.js"></script>
3、封装的axios里使用
const BASE_URL = window.global_config.BASE_URL;
打包后生成的相同名文件夹,更改config.js就可以了