|
|
@@ -521,7 +521,6 @@ const doSendMessageStream = async userMessage => {
|
|
|
}
|
|
|
|
|
|
if (data.eventType === 'TEXT') {
|
|
|
- console.log("========",data)
|
|
|
|
|
|
// 如果内容为空,就不处理。
|
|
|
if (data.receive?.content === '') {
|
|
|
@@ -579,7 +578,7 @@ const stopStream = async () => {
|
|
|
conversationInAbortController.value.abort()
|
|
|
}
|
|
|
// 销毁语音读取
|
|
|
- stopPlayback();
|
|
|
+ // stopPlayback();
|
|
|
// 设置为 false
|
|
|
conversationInProgress.value = false
|
|
|
|
|
|
@@ -665,6 +664,10 @@ onMounted(() => {
|
|
|
// 组件卸载时清理语音资源
|
|
|
onUnmounted(() => {
|
|
|
stopPlayback();
|
|
|
+ // 确保在组件卸载时也停止 SSE 流
|
|
|
+ if (conversationInProgress.value) {
|
|
|
+ stopStream();
|
|
|
+ }
|
|
|
});
|
|
|
</script>
|
|
|
|