重构MessageRecord组件,更新样式文件引用,优化消息转发逻辑,新增消息过滤功能以提升用户体验和代码可读性。

This commit is contained in:
2025-10-24 14:44:25 +08:00
parent bb6453d3a2
commit e1d4f678ab
7 changed files with 73 additions and 24 deletions

View File

@@ -26,7 +26,6 @@ export const useCkChatStore = createPersistStore<CkChatState>(
return useCkChatStore.getState().isLoadWeChat;
},
updateIsLoadWeChat: (isLoadWeChat: boolean) => {
console.log("updateIsLoadWeChat", isLoadWeChat);
set({ isLoadWeChat });
},
//客服列表

View File

@@ -313,23 +313,23 @@ export const useWeChatStore = create<WeChatState>()(
} else {
params.friendMessage = [message];
}
const dataProcessingResult = await dataProcessing(params);
//如果成功就请求ai对话接口
set(() => ({
isLoadingAiChat: true,
}));
if (!dataProcessingResult) {
const messageContent = await aiChat({
friendId: getMessageId,
wechatAccountId: currentContract.wechatAccountId,
message: message,
});
// const dataProcessingResult = await dataProcessing(params);
// //如果成功就请求ai对话接口
// set(() => ({
// isLoadingAiChat: true,
// }));
// if (!dataProcessingResult) {
// const messageContent = await aiChat({
// friendId: getMessageId,
// wechatAccountId: currentContract.wechatAccountId,
// message: message,
// });
set(() => ({
quoteMessageContent: messageContent,
isLoadingAiChat: false,
}));
}
// set(() => ({
// quoteMessageContent: messageContent,
// isLoadingAiChat: false,
// }));
// }
} else {
// 更新其他聊天的未读消息数
const chatSessions = useCkChatStore.getState().chatSessions;

View File

@@ -123,7 +123,7 @@ const messageHandlers: Record<string, MessageHandler> = {
await db.kfUsers.clear();
await db.weChatGroup.clear();
await db.contracts.clear();
await db.newContractList.clear();
await db.newContactList.clear();
} finally {
(window as any).__CKB_AUTH_FAILED_SHOWN__ = false;
window.location.href = "/login";