配置不同命令,连接不同环境

This commit is contained in:
BOOL\25024
2025-03-06 15:21:33 +08:00
parent d8c692ed28
commit 578c6beaaa
5 changed files with 12 additions and 10 deletions

View File

@@ -1,11 +1,11 @@
# 页面标题
VUE_APP_TITLE = 万车充运营管理平台
# 开发环境配置
# pre环境配置
ENV = 'development'
# 万车充运营管理平台/开发环境
VUE_APP_BASE_API = '/dev-api'
# 万车充运营管理平台/pre环境
VUE_APP_BASE_API = 'https://apitest.jsowellcloud.com'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@@ -1,8 +1,8 @@
# 页面标题
VUE_APP_TITLE = 万车充运营管理平台
# 生产环境配置
# 正式环境配置
ENV = 'production'
# 万车充运营管理平台/生产环境
VUE_APP_BASE_API = '/prod-api'
# 万车充运营管理平台/正式环境
VUE_APP_BASE_API = 'https://api.jsowellcloud.com'

View File

@@ -5,7 +5,7 @@ VUE_APP_TITLE = 万车充运营管理平台
ENV = 'staging'
# 万车充运营管理平台/测试环境
VUE_APP_BASE_API = '/dev-api'
VUE_APP_BASE_API = 'http://192.168.2.21:8080'
# 开发环境配置
NODE_ENV = production

View File

@@ -3,7 +3,9 @@
"version": "1.0.0",
"description": "万车充管理系统",
"scripts": {
"dev": "vue-cli-service serve",
"dev": "vue-cli-service serve --mode production",
"pre": "vue-cli-service serve --mode development",
"test": "vue-cli-service serve --mode staging",
"build:prod": "vue-cli-service build",
"build:stage": "vue-cli-service build --mode staging",
"preview": "node build/index.js --preview",

View File

@@ -35,12 +35,12 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
// target: `http://localhost:8080`,
target: `http://localhost:8080`,
// 更改代理为本地地址
// target: `http://106.14.94.149:8080`,
// target: `http://192.168.2.21:8080`,
// target: `https://api.jsowellcloud.com`,
target: `https://apitest.jsowellcloud.com`,
// target: `https://apitest.jsowellcloud.com`,
changeOrigin: true,
pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "",