修改主机地址

This commit is contained in:
2026-04-12 11:53:28 +08:00
parent f0cc37681c
commit 0ec92b10a1
13 changed files with 76 additions and 11 deletions

View File

@@ -0,0 +1,11 @@
# 前端生产环境配置
# 构建时使用的环境变量
# API 基础 URL
# Docker Compose 部署(前端独立构建,后端在 47.238.126.111:33001
VITE_API_BASE_URL=http://47.238.126.111:33001
# 传统部署Nginx 反向代理):
# VITE_API_BASE_URL=/api # 如果使用 Nginx 反向代理到后端,可以设置为相对路径 /api
# 其他环境变量可根据需要添加

View File

@@ -3,7 +3,7 @@ import axios from 'axios';
const TOKEN_KEY = 'auth_token';
const http = axios.create({
baseURL: import.meta.env.VITE_API_BASE_URL || 'http://localhost:3001',
baseURL: import.meta.env.VITE_API_BASE_URL || 'http://localhost:33001',
timeout: 15000,
});

View File

@@ -7,7 +7,7 @@ export default defineConfig({
port: 3000,
proxy: {
'/api': {
target: process.env.VITE_API_URL || 'http://localhost:3001',
target: process.env.VITE_API_URL || 'http://localhost:33001',
changeOrigin: true,
},
},