Procházet zdrojové kódy

优化:聊天监听到断网,则立即把连接状态标记为 false,让其发不了消息

shizhongqi před 10 měsíci
rodič
revize
d657d972f9

+ 4 - 3
hdApp/src/admin/chat/chatPage.vue

@@ -446,10 +446,11 @@ export default {
             }, 3000);
           }
 
+          this.isConnected = false;
           // 尝试重新连接超过 maxReconnectCount 次才标记为未连接状态
-          if (!this.isManualDisconnect && this.reconnectCount >= this.maxReconnectCount) {
-            this.isConnected = false;
-          }
+          // if (!this.isManualDisconnect && this.reconnectCount >= this.maxReconnectCount) {
+          //   this.isConnected = false;
+          // }
         });
 
         // 监听WebSocket错误

+ 4 - 3
mallApp/src/pages/chat/chatPage.vue

@@ -530,10 +530,11 @@ export default {
             }, 3000);
           }
 
+          this.isConnected = false;
           // 尝试重新连接超过 maxReconnectCount 次才标记为未连接状态
-          if (!this.isManualDisconnect && this.reconnectCount >= this.maxReconnectCount) {
-            this.isConnected = false;
-          }
+          // if (!this.isManualDisconnect && this.reconnectCount >= this.maxReconnectCount) {
+          //   this.isConnected = false;
+          // }
         });
 
         // 监听WebSocket错误