fix:实时通信会话错乱

This commit is contained in:
JiXinHui 2026-03-19 15:36:13 +08:00
parent 8f8ace89e1
commit a01b8c957a
1 changed files with 25 additions and 14 deletions

39
App.vue
View File

@ -232,20 +232,31 @@ export default {
message: data.Message,
};
const id = data.Id || data.id || Math.random().toString(36).substring(2);
const msg = {
...processData,
messageType: 0,
filePath: "",
id,
};
const storeState = (this.$store && this.$store.state) || {};
const isTransferChat = !!storeState.vuex_isTransferChat;
if (isTransferChat) {
this.$store.commit("push_AiLiveAgentMsg", msg);
} else {
this.$store.commit("push_Msg", msg);
}
const msg = {
...processData,
messageType: 0,
filePath: "",
id,
};
const storeState = (this.$store && this.$store.state) || {};
const isTransferChat = !!storeState.vuex_isTransferChat;
const activeDialogueId =
storeState.vuex_msgUser?.dialogueManagementId ||
storeState.vuex_msgUser?.friendId ||
storeState.vuex_msgUser?.id;
const isActiveChat =
activeDialogueId &&
String(activeDialogueId) === String(processData.dialogueManagementId);
if (isTransferChat) {
if (isActiveChat) {
this.$store.commit("push_AiLiveAgentMsg", msg);
}
} else {
if (isActiveChat) {
this.$store.commit("push_Msg", msg);
}
}
// / /
if (processData.dialogueManagementId) {