FEAT => 本次更新项目为:

This commit is contained in:
超级老白兔
2025-09-04 16:33:03 +08:00
parent 12d8c39ccf
commit 711159aa2b
2 changed files with 18 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
import { create } from "zustand";
import { persist } from "zustand/middleware";
import { getChatMessages } from "@/pages/pc/ckbox/api";
import { getChatMessages, getChatroomMessages } from "@/pages/pc/ckbox/api";
import { WeChatState } from "./weChat.data";
import { clearUnreadCount, updateConfig } from "@/pages/pc/ckbox/api";
import { ContractData, weChatGroup } from "@/pages/pc/ckbox/data";
@@ -49,18 +49,19 @@ export const useWeChatStore = create<WeChatState>()(
wechatAccountId: contact.wechatAccountId,
From: 1,
To: 4704624000000,
Count: 10,
Count: 5,
olderData: true,
};
if ("chatroomId" in contact && contact.chatroomId) {
params.wechatChatroomId = contact.id;
const messages = await getChatroomMessages(params);
set({ currentMessages: messages || [] });
} else {
params.wechatFriendId = contact.id;
const messages = await getChatMessages(params);
set({ currentMessages: messages || [] });
}
const messages = await getChatMessages(params);
set({ currentMessages: messages || [] });
} catch (error) {
console.error("获取聊天消息失败:", error);
} finally {