From 810336f9892a8ff77d1f6a524a12bd62a2591063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=8E=E4=BD=97?= Date: Mon, 1 Jun 2026 11:44:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20vite=20proxy=20=E6=94=AF=E6=8C=81=20VITE?= =?UTF-8?q?=5FAPI=5FPROXY=20=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E8=A6=86?= =?UTF-8?q?=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 不再硬编码端口,通过 systemd Environment=VITE_API_PROXY=xxx 注入 默认值仍为 18080(兼容原始配置) --- openhis-ui-vue3/vite.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openhis-ui-vue3/vite.config.js b/openhis-ui-vue3/vite.config.js index 4367998ae..5881e5af3 100755 --- a/openhis-ui-vue3/vite.config.js +++ b/openhis-ui-vue3/vite.config.js @@ -40,7 +40,7 @@ export default defineConfig(({ mode, command }) => { proxy: { // https://cn.vitejs.dev/config/#server-proxy '/dev-api': { - target: 'http://localhost:18082/openhis', + target: process.env.VITE_API_PROXY || 'http://localhost:18080/openhis', changeOrigin: true, rewrite: (p) => p.replace(/^\/dev-api/, ''), },