From 723ce7aa52d0a09110654b2926fb226e2793bbd4 Mon Sep 17 00:00:00 2001 From: "1378012178@qq.com" <1378012178@qq.com> Date: Tue, 15 Apr 2025 09:47:30 +0800 Subject: [PATCH] =?UTF-8?q?121=EF=BC=88=E6=96=B0uat=EF=BC=89=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 ++-- .env.production | 6 +++--- vite.config.ts | 3 +++ 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.env.development b/.env.development index 71b38e8..77f9b16 100644 --- a/.env.development +++ b/.env.development @@ -6,13 +6,13 @@ VITE_PUBLIC_PATH = / # 跨域代理,您可以配置多个 ,请注意,没有换行符 -VITE_PROXY = [["/nursing-unit","http://localhost:8081/nursing-unit_001"],["/upload","http://localhost:3300/upload"]] +VITE_PROXY = [["/nursing-unit-001","http://localhost:8081/nursing-unit_001"],["/upload","http://localhost:3300/upload"]] #后台接口全路径地址(必填) VITE_GLOB_DOMAIN_URL=http://localhost:8081/nursing-unit_001 #后台接口父地址(必填) -VITE_GLOB_API_URL=/nursing-unit +VITE_GLOB_API_URL=/nursing-unit-001 # 接口前缀 VITE_GLOB_API_URL_PREFIX= diff --git a/.env.production b/.env.production index 8dfb175..bd50bed 100644 --- a/.env.production +++ b/.env.production @@ -2,7 +2,7 @@ VITE_USE_MOCK = false # 发布路径 -VITE_PUBLIC_PATH = / +VITE_PUBLIC_PATH = /nu001 # 是否启用gzip或brotli压缩 # 选项值: gzip | brotli | none @@ -13,10 +13,10 @@ VITE_BUILD_COMPRESS = 'gzip' VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false #后台接口父地址(必填) -VITE_GLOB_API_URL=/nursing-unit +VITE_GLOB_API_URL=/nursing-unit_001 #后台接口全路径地址(必填) -VITE_GLOB_DOMAIN_URL=http://nursing-unit-system:8080/nursing-unit +VITE_GLOB_DOMAIN_URL=http://121.36.88.64/nursing-unit_001 # 接口父路径前缀 VITE_GLOB_API_URL_PREFIX= diff --git a/vite.config.ts b/vite.config.ts index 1c872b3..4489883 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -80,6 +80,9 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { port: VITE_PORT, // Load proxy configuration from .env proxy: createProxy(VITE_PROXY), + // headers: { + // 'Content-Security-Policy': "default-src 'self'; script-src 'self' 'unsafe-inline'" + // }, // 合并 server 配置 ...serverOptions, },