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.
This commit is contained in:
Kunthawat Greethong
2026-06-17 12:08:04 +07:00
parent cbe861ff27
commit aadc11ad83

View File

@@ -3,7 +3,7 @@ import i18n from '../i18n'
// 创建axios实例 // 创建axios实例
const service = axios.create({ 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分钟超时本体生成可能需要较长时间 timeout: 300000, // 5分钟超时本体生成可能需要较长时间
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'