From 848b623cf3cf24f9065a621825a6db7310f66cb0 Mon Sep 17 00:00:00 2001 From: fangjiakai <450850793@qq.com> Date: Tue, 27 Feb 2024 10:47:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=89=E9=A1=B9=E5=88=B6=E5=BA=A6=E5=BA=93?= =?UTF-8?q?=E4=BB=A3=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 4 +++- vite.config.js | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.env b/.env index bb915a4..ab2a573 100644 --- a/.env +++ b/.env @@ -1,5 +1,7 @@ -VITE_BASE_URL=http://192.168.0.55:8088/ +VITE_BASE_URL=http://192.168.0.42:8099/ VITE_PROXY=/api/ +VITE_PROXY_QAAQ=/qaaq_api/ +VITE_QAAQ_URL=https://gateway.qhdsafety.com/ VITE_FILE_URL=https://file.zcloudchina.com/YTHFile VITE_TEMPLATE_URL=https://qaaq.qhdsafety.com/file/ VITE_ON_LINE_WEB_SOCKET_URL=wss://qaaq.qhdsafety.com/zxwebsocket/ diff --git a/vite.config.js b/vite.config.js index 6790793..f3b4fdb 100644 --- a/vite.config.js +++ b/vite.config.js @@ -66,6 +66,12 @@ export default ({ mode }) => { ws: true, rewrite: (path) => path.replace(/^\/api/, ""), }, + [loadEnv(mode, process.cwd()).VITE_PROXY_QAAQ]: { + target: loadEnv(mode, process.cwd()).VITE_QAAQ_URL, + changeOrigin: true, + ws: true, + rewrite: (path) => path.replace(/^\/qaaq_api/, ""), + }, }, }, resolve: {