feat: Socket.IO 连接地址(Mock 模式下连接生产环境)

This commit is contained in:
zdl
2025-11-21 18:22:18 +08:00
parent ed584b72d4
commit c9084ebb33
2 changed files with 8 additions and 1 deletions

View File

@@ -7,7 +7,10 @@ import { io } from 'socket.io-client';
import { logger } from '../utils/logger';
import { getApiBase } from '../utils/apiConfig';
const API_BASE_URL = getApiBase();
// 优先使用 REACT_APP_SOCKET_URL专门为 Socket.IO 配置)
// 如果未配置,则使用 getApiBase()(与 HTTP API 共用地址)
// Mock 模式下可以通过 .env.mock 配置 REACT_APP_SOCKET_URL=https://valuefrontier.cn 连接生产环境
const API_BASE_URL = process.env.REACT_APP_SOCKET_URL || getApiBase();
class SocketService {
constructor() {