diff --git a/im-ui/src/store/chatStore.js b/im-ui/src/store/chatStore.js index 9328c18..ca1debf 100644 --- a/im-ui/src/store/chatStore.js +++ b/im-ui/src/store/chatStore.js @@ -84,7 +84,16 @@ export default { break; } } - chat.lastContent = msgInfo.type == 1 ? "[图片]" : msgInfo.type == 2 ? "[文件]" : msgInfo.content; + console.log(msgInfo.type) + if(msgInfo.type == 1){ + chat.lastContent = "[图片]"; + }else if(msgInfo.type == 2){ + chat.lastContent = "[文件]"; + }else if(msgInfo.type == 3){ + chat.lastContent = "[语音]"; + }else{ + chat.lastContent = msgInfo.content; + } chat.lastSendTime = msgInfo.sendTime; chat.messages.push(msgInfo); // 如果不是当前会话,未读加1