开发过程中 npm run dev 组件中接口调取的地址是 全局global定义的一个API变量如下:
npm run dev
global
// 开发环境打开 ↓↓↓
// global.API = '/api';
// 生产环境打开 ↓↓↓
// global.API = '';
this.$http.post(API + '/User/ResetPwd', {id: id})
生产环境 npm run build 时如何自动改变API成生产环境变量?
npm run build
相关分类