feat(消息处理): 添加sendUserType字段到消息对象

This commit is contained in:
yangzhe 2026-03-19 16:36:40 +08:00
parent af1a29c071
commit f043ee6fa3
2 changed files with 27 additions and 25 deletions

51
App.vue
View File

@ -230,33 +230,34 @@ export default {
receiverId: data.ReceiverId,
sendDate: data.SendDate,
message: data.Message,
sendUserType: 2,
};
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;
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);
}
}
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) {

View File

@ -223,6 +223,7 @@ const store = new Vuex.Store({
isRead: true,
interactMode: isSelf ? 0 : 8,
messageType: msg.messageType || msg.MessageType || 0,
sendUserType: msg.sendUserType,
timeLabel: 0,
displayTime: "",
});