tp save
This commit is contained in:
parent
0a1908616f
commit
58de9e9af5
|
@ -361,7 +361,7 @@ const sendMessage = () => {
|
||||||
})
|
})
|
||||||
} else if (pathname.value == '/main_serve') {
|
} else if (pathname.value == '/main_serve') {
|
||||||
var mgsid= uuidv4()
|
var mgsid= uuidv4()
|
||||||
messages.push({ id: mgsid, text: '媒体流加载中', isMe: false, type: 'txt' });
|
messages.push({ id: mgsid, text: '加载中...', isMe: false, type: 'txt' });
|
||||||
fetchEventSource('/main_serve', {
|
fetchEventSource('/main_serve', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -374,8 +374,9 @@ const sendMessage = () => {
|
||||||
console.log("媒体流", JSON.parse(ev.data).response);
|
console.log("媒体流", JSON.parse(ev.data).response);
|
||||||
messages.map((v,i)=>{
|
messages.map((v,i)=>{
|
||||||
if(v.id==mgsid){
|
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
|
v.text+=JSON.parse(ev.data).response
|
||||||
|
scollToButtom()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue