xie.bx пре 3 година
родитељ
комит
57ad2a6222
1 измењених фајлова са 10 додато и 1 уклоњено
  1. 10 1
      im-ui/src/store/chatStore.js

+ 10 - 1
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