Enhance file upload process in devlop.py with progress tracking and remote file validation. Add aiType field to weChatGroup and ContractData interfaces for AI type differentiation. Update ChatWindow component to handle AI configuration changes and ensure proper database updates for contact and message management. Implement database versioning to include aiType in chatSessions and contactsUnified tables, with migration logic for existing data. Improve error handling and user feedback during configuration updates.

This commit is contained in:
2025-10-28 16:55:55 +08:00
parent d1c35b480f
commit 0decc34593
9 changed files with 182 additions and 15 deletions

View File

@@ -138,6 +138,10 @@ export const useWeChatStore = create<WeChatState>()(
},
/** 设置当前联系人并加载相关数据 */
setCurrentContact: (contract: ContractData | weChatGroup) => {
console.log(
"setCurrentContact - contract.aiType:",
(contract as any).aiType,
); // 调试:查看 aiType 字段
const state = useWeChatStore.getState();
// 切换联系人时清空当前消息,等待重新加载
set({ currentMessages: [] });
@@ -294,7 +298,10 @@ export const useWeChatStore = create<WeChatState>()(
}));
// 只有文字消息才触发AImsgType === 1
if (message.msgType === 1) {
if (
message.msgType === 1 &&
(currentContract as any).aiType === 1
) {
//把数据传到存客宝
const params: any = {
type: "CmdNewMessage",