diff --git a/src/views/chat/index.vue b/src/views/chat/index.vue index ef8762d..7c1aca4 100644 --- a/src/views/chat/index.vue +++ b/src/views/chat/index.vue @@ -76,6 +76,7 @@ const changeRecord = ()=>{ else { RecordXunfei() recordFalg.value = 0 + nowStatus.value = 'input' } } @@ -232,9 +233,11 @@ async function onConversation() { ) // 关闭连接 if(msg.header.code!=0||(event.data&&msg.header.status==2)){ + nowStatus.value = 'input' socket.close() } } catch (error) { + nowStatus.value = 'input' socket.close() } } @@ -592,13 +595,7 @@ onUnmounted(() => { if (loading.value) controller.abort() }) -const iatRecorder = reactive(new IatRecorder()) -const a = true -// watch(() => iatRecorder.resultText, (n, o) => { -// console.log('监听', n) -// prompt.value = n -// }) window.winText = '' @@ -607,31 +604,15 @@ window.addEventListener('test', (e) => { prompt.value = window.winText }) -const click = () => { - // prompt.value = window.winText - RecordXunfei() - - // if (a) { - // iatRecorder.start(prompt.value) - // a = !a - // console.log('录音开始') - // } - // else { - // iatRecorder.stop() - // a = !a - // console.log('录音结束') - // console.log('最终结果', iatRecorder) - // } -}