|
@@ -160,7 +160,7 @@ export const useWebSocketStore = defineStore("webSocketStore", {
|
|
}
|
|
}
|
|
|
|
|
|
console.log("WebSocket 连接成功");
|
|
console.log("WebSocket 连接成功");
|
|
- showNotify({ type: 'success', message: '服务器连接成功' });
|
|
|
|
|
|
+ // showNotify({ type: 'success', message: '服务器连接成功' });
|
|
this.flushMessageQueue(); // 连接成功后立即发送队列中的消息
|
|
this.flushMessageQueue(); // 连接成功后立即发送队列中的消息
|
|
};
|
|
};
|
|
|
|
|
|
@@ -171,7 +171,7 @@ export const useWebSocketStore = defineStore("webSocketStore", {
|
|
|
|
|
|
this.socket.onclose = () => {
|
|
this.socket.onclose = () => {
|
|
this.connectionState = "disconnected";
|
|
this.connectionState = "disconnected";
|
|
- showNotify({ type: 'warning', message: '服务器连接断开' });
|
|
|
|
|
|
+ // showNotify({ type: 'warning', message: '服务器连接断开' });
|
|
this.cleanupTimers();
|
|
this.cleanupTimers();
|
|
|
|
|
|
if (
|
|
if (
|
|
@@ -185,7 +185,7 @@ export const useWebSocketStore = defineStore("webSocketStore", {
|
|
this.socket.onerror = (error) => {
|
|
this.socket.onerror = (error) => {
|
|
this.connectionState = "error";
|
|
this.connectionState = "error";
|
|
console.error("WebSocket 错误并 重新连接:", error);
|
|
console.error("WebSocket 错误并 重新连接:", error);
|
|
- showNotify({ type: 'warning', message: '服务器连接断开' });
|
|
|
|
|
|
+ // showNotify({ type: 'warning', message: '服务器连接断开' });
|
|
this.cleanupTimers();
|
|
this.cleanupTimers();
|
|
this.scheduleReconnect();
|
|
this.scheduleReconnect();
|
|
};
|
|
};
|