diff --git a/src/views/chat/index.vue b/src/views/chat/index.vue index ad34cb2..1bb5baf 100644 --- a/src/views/chat/index.vue +++ b/src/views/chat/index.vue @@ -169,7 +169,7 @@ async function onConversation() { try { let lastText = '' - let mp3: any = [] + const mp3: any = [] console.log('发送消息', message) const fetchChatAPIOnce = async () => { @@ -188,18 +188,19 @@ async function onConversation() { const msg = JSON.parse(event.data) // console.log(`收到消息: `, msg.payload.choices.text[0].content); // console.log(`当前消息: `, dataSources.value[dataSources.value.length - 1].text); - lastText += msg.payload.choices.text[0].content; - mp3.push(msg.payload.choices.mp3) + lastText += msg.payload.choices.text[0].content + mp3.push(msg.payload.choices.mp3) + const loading = true updateChat( +uuid, dataSources.value.length - 1, { dateTime: new Date().toLocaleString(), text: lastText, - mp3: mp3, + mp3, inversion: false, error: false, - loading: true, + loading, conversationOptions: { conversationId: msg.header.sid, parentMessageId: msg.header.sid }, requestOptions: { prompt: message, options: { ...options } }, }, @@ -635,7 +636,7 @@ const click = () => { :key="index" :date-time="item.dateTime" :text="item.text" - :mp3="item.mp3" + :mp3="item.mp3" :inversion="item.inversion" :error="item.error" :loading="item.loading" @@ -686,7 +687,6 @@ const click = () => { >