fix: vite proxy 支持 VITE_API_PROXY 环境变量覆盖
不再硬编码端口,通过 systemd Environment=VITE_API_PROXY=xxx 注入 默认值仍为 18080(兼容原始配置)
This commit is contained in:
@@ -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/, ''),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user