FEAT => 本次更新项目为:
This commit is contained in:
@@ -99,7 +99,7 @@ export const initSocket = () => {
|
||||
const { status } = useWebSocketStore.getState();
|
||||
|
||||
// 如果已经连接或正在连接,则不重复连接
|
||||
if (status === "connected" || status === "connecting") {
|
||||
if (["connected", "connecting"].includes(status)) {
|
||||
console.log("WebSocket已连接或正在连接,跳过重复连接", { status });
|
||||
return;
|
||||
}
|
||||
|
||||
0
Cunkebao/src/store/module/websocket/sendMessages.ts
Normal file
0
Cunkebao/src/store/module/websocket/sendMessages.ts
Normal file
@@ -137,16 +137,7 @@ export const useWebSocketStore = createPersistStore<WebSocketState>(
|
||||
t: Date.now().toString(),
|
||||
});
|
||||
|
||||
// 调试信息:输出配置和环境变量
|
||||
// console.log("WebSocket配置信息:", {
|
||||
// configUrl: fullConfig.url,
|
||||
// envUrl: (import.meta as any).env?.VITE_API_WS_URL,
|
||||
// fullConfig,
|
||||
// params: params.toString(),
|
||||
// });
|
||||
|
||||
const wsUrl = fullConfig.url + "?" + params;
|
||||
// console.log("最终WebSocket URL:", wsUrl);
|
||||
|
||||
// 检查URL是否为localhost,如果是则不连接
|
||||
if (wsUrl.includes("localhost") || wsUrl.includes("127.0.0.1")) {
|
||||
|
||||
Reference in New Issue
Block a user