diff --git a/src/views/chat/components/VoiceInput.vue b/src/views/chat/components/VoiceInput.vue index 12360b5..6f994bf 100644 --- a/src/views/chat/components/VoiceInput.vue +++ b/src/views/chat/components/VoiceInput.vue @@ -117,7 +117,7 @@ const wsConfig = { try { const data = JSON.parse(event.data) if (data.text) { - realTimeText.value = data.text + realTimeText.value += data.text } } catch (error) { console.error('WebSocket message parse error:', error) @@ -213,19 +213,6 @@ const confirmVoiceInput = async () => { closeVoiceModal() } -const sendAsText = () => { - if (isRecording.value) { - stopRecording() - isRecording.value = false - - if (realTimeText.value) { - emit('sendText', realTimeText.value) - } else { - ElMessage.warning('没有识别到文字') - } - } - closeVoiceModal() -} const startRecording = (stream) => { audioChunks = []