From aadc11ad83f383a8f0b6dc2a5e1f07dfbbaf956e Mon Sep 17 00:00:00 2001 From: Kunthawat Greethong Date: Wed, 17 Jun 2026 12:08:04 +0700 Subject: [PATCH] fix: use relative baseURL so API calls go through vite proxy When deployed behind a reverse proxy (e.g. opinion.moreminimore.com), hardcoding http://localhost:5001 causes the browser to try connecting to the user's own machine. Empty baseURL + vite proxy fixes this. --- frontend/src/api/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/api/index.js b/frontend/src/api/index.js index e840e11..2f5c1a3 100644 --- a/frontend/src/api/index.js +++ b/frontend/src/api/index.js @@ -3,7 +3,7 @@ import i18n from '../i18n' // 创建axios实例 const service = axios.create({ - baseURL: import.meta.env.VITE_API_BASE_URL || 'http://localhost:5001', + baseURL: import.meta.env.VITE_API_BASE_URL || '', timeout: 300000, // 5分钟超时(本体生成可能需要较长时间) headers: { 'Content-Type': 'application/json'