fix(api): use relative baseURL to fix docker deployment API requests

This fixes the issue where the frontend in docker tries to connect to localhost instead of the Vite proxy.
This commit is contained in:
WinJay 2026-03-12 15:48:21 +08:00
parent 985f89f49a
commit 80a4c5f6ad
2 changed files with 1 additions and 2 deletions

View File

@ -2,7 +2,7 @@ import axios from 'axios'
// 创建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'

View File

@ -6,7 +6,6 @@ export default defineConfig({
plugins: [vue()],
server: {
port: 3000,
open: true,
proxy: {
'/api': {
target: 'http://localhost:5001',