Przeglądaj źródła

1、ai对话不处理空

liyanbo 8 miesięcy temu
rodzic
commit
f28bf97a13
1 zmienionych plików z 5 dodań i 4 usunięć
  1. 5 4
      src/views/AIQuestions.vue

+ 5 - 4
src/views/AIQuestions.vue

@@ -349,14 +349,15 @@ const doSendMessageStream = async (userMessage) => {
           console.log(`对话异常! ${msg}`);
           return;
         }
-        // 如果内容为空,就不处理。
-        // if (data.receive?.content === '') {
-        //   return
-        // }
 
         // 根据事件类型处理
         if (data.eventType === 'TEXT') {
 
+          // 如果内容为空,就不处理。
+          if (data.receive?.content === '') {
+            return
+          }
+
           // 处理文本消息
           receiveMessageFullText.value += data.receive.content;