This commit is contained in:
liuyalei 2024-03-18 11:18:00 +08:00
parent 0a1908616f
commit 58de9e9af5
1 changed files with 3 additions and 2 deletions

View File

@ -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()
}
})
}