|
@@ -165,11 +165,14 @@ const wsReceive = (message: any) => {
|
|
if (data.body.content.action === 1) {
|
|
if (data.body.content.action === 1) {
|
|
// 通话中
|
|
// 通话中
|
|
if (messageList.value.length) {
|
|
if (messageList.value.length) {
|
|
- // 根据index判断是否是同一句话 如果是同一句话就不添加
|
|
|
|
- if (messageList.value[messageList.value.length - 1].body.content.callSentenceInfo.index !== data.body.content.callSentenceInfo.index) {
|
|
|
|
- messageList.value.push(data);
|
|
|
|
- } else {
|
|
|
|
- messageList.value[messageList.value.length - 1].body.content.callSentenceInfo.text = data.body.content.callSentenceInfo.text; // 替换内容
|
|
|
|
|
|
+ for (let i of messageList.value) {
|
|
|
|
+ if (i.body.content.callSentenceInfo.index === data.body.content.callSentenceInfo.index) {
|
|
|
|
+ // 如果index相同就替换内容
|
|
|
|
+ i.body.content.callSentenceInfo.text = data.body.content.callSentenceInfo.text;
|
|
|
|
+ } else {
|
|
|
|
+ //index不同就添加
|
|
|
|
+ messageList.value.push(data);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
messageList.value.push(data);
|
|
messageList.value.push(data);
|