1,配置 package.json
"scripts": {
"serve:dev": "vue-cli-service serve --mode development",
"serve:prod": "vue-cli-service serve --mode production",
"serve:test": "vue-cli-service serve --mode test",
"build:dev": "vue-cli-service build --mode development",
"build:prod": "vue-cli-service build --mode production",
"build:test": "vue-cli-service build --mode test",
"lint": "vue-cli-service lint"
},
2,根目录下新建
个人开发本地
生产环境地址
测试环境地址
3,请求baseURL
Axios.defaults.baseURL = process.env.VUE_APP_BASE_API;