From 58de9e9af5b9317377a04720ef0fd45e1ccd0ab1 Mon Sep 17 00:00:00 2001 From: liuyalei Date: Mon, 18 Mar 2024 11:18:00 +0800 Subject: [PATCH] tp save --- src/views/IndexChat.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/IndexChat.vue b/src/views/IndexChat.vue index add18e1..2c53b22 100644 --- a/src/views/IndexChat.vue +++ b/src/views/IndexChat.vue @@ -361,7 +361,7 @@ const sendMessage = () => { }) } else if (pathname.value == '/main_serve') { var mgsid= uuidv4() - messages.push({ id: mgsid, text: '媒体流加载中', isMe: false, type: 'txt' }); + messages.push({ id: mgsid, text: '加载中...', isMe: false, type: 'txt' }); fetchEventSource('/main_serve', { method: 'POST', headers: { @@ -374,8 +374,9 @@ const sendMessage = () => { console.log("媒体流", JSON.parse(ev.data).response); messages.map((v,i)=>{ if(v.id==mgsid){ - // console.log("JSON.parse(ev.data).response",JSON.parse(ev.data).response); + v.text= v.text.replace('加载中...','') v.text+=JSON.parse(ev.data).response + scollToButtom() } }) }