开发环境配置
1. 在项目根目录下新建 .env.development 文件(admin版已建好)

# just a flag
ENV = 'development'
# base api 开发环境的api
VUE_APP_BASE_API = 'http://127.0.0.1:50001/' // 你本地的api
3. 在request.js文件中设置baseURL
baseURL: process.env.VUE_APP_BASE_API
到此完成开发环境配置,执行npm run dev时api自动使用.env.development的api
生产环境
1. 在项目根目录下新建.env.production

# just a flag
ENV = 'production'
# base api
VUE_APP_BASE_API = 'http://xx.xxx.xx.xx:xxx/' // 你的生产环境api
3. 到此生产环境配置完成, 执行 npm run build指令默认自动使用.env.production里的api