From f64693c0da5483d8670220bf3a5bf89a32e94a20 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期五, 07 十一月 2025 10:34:21 +0800
Subject: [PATCH] 解决线上打包问题
---
web/vite.config.ts | 15 ++-------------
1 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/web/vite.config.ts b/web/vite.config.ts
index d0a27bd..e44174f 100644
--- a/web/vite.config.ts
+++ b/web/vite.config.ts
@@ -15,22 +15,11 @@
open: true,
proxy: {
'/api': {
+ // 灏咥PI浠g悊鍥炴湰鍦板悗绔紝渚夸簬瀹屾暣鑱旇皟锛堝悗绔繍琛屽湪 http://127.0.0.1:8080/api锛�
target: 'http://127.0.0.1:8080',
changeOrigin: true,
secure: false,
- configure: (proxy, options) => {
- proxy.on('error', (err, req, res) => {
- console.log('proxy error', err);
- });
- proxy.on('proxyReq', (proxyReq, req, res) => {
- console.log('Sending Request to the Target:', req.method, req.url);
- });
- proxy.on('proxyRes', (proxyRes, req, res) => {
- console.log('Received Response from the Target:', proxyRes.statusCode, req.url);
- });
- },
- // 涓嶉渶瑕侀噸鍐欒矾寰勶紝鍥犱负鍚庣鐨刢ontext-path灏辨槸/api
- // rewrite: (path) => path.replace(/^\/api/, '/api')
+ // 涓嶉渶瑕侀噸鍐欒矾寰勶紝鍥犱负鍚庣鐨刢ontext-path灏辨槸 /api
}
}
},
--
Gitblit v1.8.0