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:
parent
985f89f49a
commit
80a4c5f6ad
|
|
@ -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'
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ export default defineConfig({
|
|||
plugins: [vue()],
|
||||
server: {
|
||||
port: 3000,
|
||||
open: true,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:5001',
|
||||
|
|
|
|||
Loading…
Reference in New Issue