# 创建多环境配置文件 .env.dev添加内容: NODE_ENV=development VUE_APP_SERVER=http://localhost:8080.env.pord添加内容: NODE_ENV=production VUE_APP_SERVER=http://gblfy.com:8080在package.json修改如下 "scripts": {"serve-dev": "vue-cli-service serve --mode dev --port=8081","serve-prod": "vue-cli-service serve --mode prod","build-dev": "vue-cli-service build --mode dev","build-prod": "vue-cli-service build --mode prod","lint": "vue-cli-service lint"},注:--port=8081可以指定vue启动的端口在main.ts文件中添加打印日志,进行验证console.log('环境:', process.env.NODE_ENV);console.log('服务端:', process.env.VUE_APP_SERVER);