fix(websocket): 🐛 完善WebSocket端点配置检查逻辑
在所有WebSocket相关组件中添加对VITE_APP_WS_ENDPOINT的检查 确保未配置WebSocket端点时不会尝试建立连接 防止出现"brokerURL or webSocketFactory must be provided"错误
This commit is contained in:
@@ -59,6 +59,13 @@ function createDictSyncHook() {
|
||||
*/
|
||||
const initWebSocket = async () => {
|
||||
try {
|
||||
// 检查是否配置了WebSocket端点
|
||||
const wsEndpoint = import.meta.env.VITE_APP_WS_ENDPOINT;
|
||||
if (!wsEndpoint) {
|
||||
console.log("[WebSocket] 未配置WebSocket端点,跳过连接");
|
||||
return;
|
||||
}
|
||||
|
||||
// 连接WebSocket
|
||||
connect();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user