重构MessageRecord组件,更新样式文件引用,优化消息转发逻辑,新增消息过滤功能以提升用户体验和代码可读性。
This commit is contained in:
@@ -26,7 +26,6 @@ export const useCkChatStore = createPersistStore<CkChatState>(
|
||||
return useCkChatStore.getState().isLoadWeChat;
|
||||
},
|
||||
updateIsLoadWeChat: (isLoadWeChat: boolean) => {
|
||||
console.log("updateIsLoadWeChat", isLoadWeChat);
|
||||
set({ isLoadWeChat });
|
||||
},
|
||||
//客服列表
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user