Explorar o código

1、ai对话不处理空

liyanbo hai 8 meses
pai
achega
f28bf97a13
Modificáronse 1 ficheiros con 5 adicións e 4 borrados
  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;