feat(websocket): 添加消息处理逻辑并清理无用代码
在websocket消息处理器中添加addMessage调用以处理新消息 移除ChatWindow组件中无用的样式和注释代码
This commit is contained in:
@@ -128,9 +128,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 右侧个人资料卡片
|
||||
.profileSider {
|
||||
background: #fff;
|
||||
@@ -629,8 +626,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.messageItem {
|
||||
.messageContent {
|
||||
max-width: 85%;
|
||||
|
||||
@@ -42,12 +42,6 @@ const MessageEnter: React.FC<MessageEnterProps> = ({ contract }) => {
|
||||
};
|
||||
sendCommand("CmdSendMessage", params);
|
||||
setInputValue("");
|
||||
// try {
|
||||
// onSendMessage(inputValue);
|
||||
// setInputValue("");
|
||||
// } catch (error) {
|
||||
// console.error("发送失败", error);
|
||||
// }
|
||||
};
|
||||
|
||||
const handleKeyPress = (e: React.KeyboardEvent) => {
|
||||
|
||||
@@ -43,6 +43,7 @@ const messageHandlers: Record<string, MessageHandler> = {
|
||||
CmdNewMessage: (message: Messages) => {
|
||||
console.log("收到消息", message.friendMessage);
|
||||
// 在这里添加具体的处理逻辑
|
||||
addMessage(message.friendMessage);
|
||||
},
|
||||
|
||||
// 登录响应
|
||||
|
||||
Reference in New Issue
Block a user