zhoushihao
2024-08-01 15791977ae913f20f3db5c3ba952bdd1be9cde6c
UI-Project/src/utils/WebSocketService.js
@@ -1,8 +1,8 @@
// WebSocketService.js
let socket = null;
let messages = '';
export const initializeWebSocket = (socketUrl, messageHandler) => {
  let messages='' ;
    if (typeof WebSocket === "undefined") {
      console.log("Your browser does not support WebSocket");
      return null;
@@ -18,7 +18,6 @@
      if (!msg.data) {
        return;
      }
      const isLastChunk = msg.data.endsWith('<END>');
      //是否为最后一块消息
      messages += msg.data;