From 2572e4c8e8d30fee0a281b39990b9c75387a5f3e Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Tue, 17 Jun 2025 17:25:59 +0800
Subject: [PATCH] chore:配置文件调整
---
.env.development | 5 ++---
vite.config.mjs | 15 ++++++++++-----
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/.env.development b/.env.development
index 488c30a..6721f90 100644
--- a/.env.development
+++ b/.env.development
@@ -10,9 +10,8 @@
VITE_APP_BASE=/manage
# 服务地址
-VITE_APP_URL = https://wrj.shuixiongit.com/api
-#VITE_APP_URL= http://192.168.1.168 rjg
-#VITE_APP_URL= http://192.168.1.33
+VITE_APP_URL = http://192.168.1.227:5174
+
#新大屏地址
VITE_APP_DASHBOARD_URL = 'https://wrj.shuixiongit.com/command-center-dashboard/'
diff --git a/vite.config.mjs b/vite.config.mjs
index 5f4dec9..0b8ec4a 100644
--- a/vite.config.mjs
+++ b/vite.config.mjs
@@ -9,6 +9,15 @@
// 判断是打生产环境包
const isProd = VITE_APP_ENV === 'production'
+ const mapApi = VITE_APP_ENV === 'development' ? {
+ target: VITE_APP_URL,
+ changeOrigin: true,
+ } : {
+ target: VITE_APP_URL,
+ changeOrigin: true,
+ rewrite: path => path.replace(/^\/api/, ''),
+ }
+
// 根据是否生产环境,动态设置压缩配置
const buildConfig = {
outDir: 'manage',
@@ -39,11 +48,7 @@
port: 5174,
// host: '192.168.1.178',
proxy: {
- '/api': {
- target: VITE_APP_URL,
- changeOrigin: true,
- rewrite: path => path.replace(/^\/api/, ''),
- },
+ '/api': mapApi
},
},
resolve: {
--
Gitblit v1.9.3