fix:实时通信会话错乱
This commit is contained in:
parent
8f8ace89e1
commit
a01b8c957a
39
App.vue
39
App.vue
|
|
@ -232,20 +232,31 @@ export default {
|
||||||
message: data.Message,
|
message: data.Message,
|
||||||
};
|
};
|
||||||
const id = data.Id || data.id || Math.random().toString(36).substring(2);
|
const id = data.Id || data.id || Math.random().toString(36).substring(2);
|
||||||
const msg = {
|
const msg = {
|
||||||
...processData,
|
...processData,
|
||||||
messageType: 0,
|
messageType: 0,
|
||||||
filePath: "",
|
filePath: "",
|
||||||
id,
|
id,
|
||||||
};
|
};
|
||||||
const storeState = (this.$store && this.$store.state) || {};
|
const storeState = (this.$store && this.$store.state) || {};
|
||||||
const isTransferChat = !!storeState.vuex_isTransferChat;
|
const isTransferChat = !!storeState.vuex_isTransferChat;
|
||||||
|
const activeDialogueId =
|
||||||
if (isTransferChat) {
|
storeState.vuex_msgUser?.dialogueManagementId ||
|
||||||
this.$store.commit("push_AiLiveAgentMsg", msg);
|
storeState.vuex_msgUser?.friendId ||
|
||||||
} else {
|
storeState.vuex_msgUser?.id;
|
||||||
this.$store.commit("push_Msg", msg);
|
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) {
|
if (processData.dialogueManagementId) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue