feat: Socket.IO 连接地址(Mock 模式下连接生产环境)
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user