Merge pull request 'fix/hard-code' (#62) from fix/hard-code into develop

Reviewed-on: http://8.161.227.145:3000/XEngineers/CamTalk/pulls/62
This commit was merged in pull request #62.
This commit is contained in:
2026-06-14 12:31:55 +08:00
18 changed files with 269 additions and 151 deletions

View File

@@ -6,7 +6,10 @@
import type { ClientMessage, ServerMessage, WsMessage } from "../types";
const WS_URL = "ws://localhost:8080/ws";
// WebSocket 地址:优先使用环境变量,否则基于当前页面地址自动推导
const WS_URL =
import.meta.env.VITE_WS_URL ||
`${window.location.protocol === "https:" ? "wss:" : "ws:"}//${window.location.host}/ws`;
const PING_INTERVAL = 30_000; // 30 秒心跳
const MAX_RECONNECT_DELAY = 30_000; // 最大重连延迟 30 秒