fix: 调整前端API基址避免跨域预检404

This commit is contained in:
root
2026-03-09 22:44:16 +08:00
parent 1a88be5bb9
commit ad408db118
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1,2 +1,2 @@
# 生产环境(前后端同域部署时可直接使用相对路径) # 生产环境(前后端同域部署时可直接使用相对路径)
VITE_API_BASE_URL=/ VITE_API_BASE_URL=http://localhost:8080/
+1 -1
View File
@@ -3,7 +3,7 @@ import { ElMessage } from 'element-plus'
// 创建 axios 实例 // 创建 axios 实例
const request = axios.create({ const request = axios.create({
baseURL: import.meta.env.VITE_API_BASE_URL || 'http://localhost:8080', baseURL: import.meta.env.VITE_API_BASE_URL || '/',
timeout: 10000 timeout: 10000
}) })