feat(消息处理): 添加sendUserType字段到消息对象
This commit is contained in:
parent
af1a29c071
commit
f043ee6fa3
51
App.vue
51
App.vue
|
|
@ -230,33 +230,34 @@ export default {
|
||||||
receiverId: data.ReceiverId,
|
receiverId: data.ReceiverId,
|
||||||
sendDate: data.SendDate,
|
sendDate: data.SendDate,
|
||||||
message: data.Message,
|
message: data.Message,
|
||||||
|
sendUserType: 2,
|
||||||
};
|
};
|
||||||
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 =
|
const activeDialogueId =
|
||||||
storeState.vuex_msgUser?.dialogueManagementId ||
|
storeState.vuex_msgUser?.dialogueManagementId ||
|
||||||
storeState.vuex_msgUser?.friendId ||
|
storeState.vuex_msgUser?.friendId ||
|
||||||
storeState.vuex_msgUser?.id;
|
storeState.vuex_msgUser?.id;
|
||||||
const isActiveChat =
|
const isActiveChat =
|
||||||
activeDialogueId &&
|
activeDialogueId &&
|
||||||
String(activeDialogueId) === String(processData.dialogueManagementId);
|
String(activeDialogueId) === String(processData.dialogueManagementId);
|
||||||
|
|
||||||
if (isTransferChat) {
|
if (isTransferChat) {
|
||||||
if (isActiveChat) {
|
if (isActiveChat) {
|
||||||
this.$store.commit("push_AiLiveAgentMsg", msg);
|
this.$store.commit("push_AiLiveAgentMsg", msg);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (isActiveChat) {
|
if (isActiveChat) {
|
||||||
this.$store.commit("push_Msg", msg);
|
this.$store.commit("push_Msg", msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新会话列表的未读数 / 文案 / 时间,保持实时展示
|
// 更新会话列表的未读数 / 文案 / 时间,保持实时展示
|
||||||
if (processData.dialogueManagementId) {
|
if (processData.dialogueManagementId) {
|
||||||
|
|
|
||||||
|
|
@ -223,6 +223,7 @@ const store = new Vuex.Store({
|
||||||
isRead: true,
|
isRead: true,
|
||||||
interactMode: isSelf ? 0 : 8,
|
interactMode: isSelf ? 0 : 8,
|
||||||
messageType: msg.messageType || msg.MessageType || 0,
|
messageType: msg.messageType || msg.MessageType || 0,
|
||||||
|
sendUserType: msg.sendUserType,
|
||||||
timeLabel: 0,
|
timeLabel: 0,
|
||||||
displayTime: "",
|
displayTime: "",
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue