feat(未讀消息清除功能): 將清除未讀消息的API函數重命名並新增第二個清除未讀消息的API,優化代碼結構以提升可讀性和維護性。
This commit is contained in:
@@ -19,9 +19,12 @@ export function WechatGroup(params) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//获取聊天记录-1 清除未读
|
//获取聊天记录-1 清除未读
|
||||||
export function clearUnreadCount(params) {
|
export function clearUnreadCount1(params) {
|
||||||
return request("/v1/kefu/message/readMessage", params, "GET");
|
return request("/v1/kefu/message/readMessage", params, "GET");
|
||||||
}
|
}
|
||||||
|
export function clearUnreadCount2(params) {
|
||||||
|
return request2("/api/WechatFriend/clearUnreadCount", params, "PUT");
|
||||||
|
}
|
||||||
|
|
||||||
//更新配置
|
//更新配置
|
||||||
export function updateConfig(params) {
|
export function updateConfig(params) {
|
||||||
|
|||||||
@@ -11,7 +11,11 @@ import {
|
|||||||
likeListItem,
|
likeListItem,
|
||||||
CommentItem,
|
CommentItem,
|
||||||
} from "@/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.data";
|
} from "@/pages/pc/ckbox/weChat/components/SidebarMenu/FriendsCicle/index.data";
|
||||||
import { clearUnreadCount, updateConfig } from "@/pages/pc/ckbox/api";
|
import {
|
||||||
|
clearUnreadCount1,
|
||||||
|
clearUnreadCount2,
|
||||||
|
updateConfig,
|
||||||
|
} from "@/pages/pc/ckbox/api";
|
||||||
import { ChatRecord, ContractData, weChatGroup } from "@/pages/pc/ckbox/data";
|
import { ChatRecord, ContractData, weChatGroup } from "@/pages/pc/ckbox/data";
|
||||||
import { weChatGroupService, contractService } from "@/utils/db";
|
import { weChatGroupService, contractService } from "@/utils/db";
|
||||||
import {
|
import {
|
||||||
@@ -150,7 +154,8 @@ export const useWeChatStore = create<WeChatState>()(
|
|||||||
params.wechatChatroomId = contract.id;
|
params.wechatChatroomId = contract.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
clearUnreadCount(params);
|
clearUnreadCount1(params);
|
||||||
|
clearUnreadCount2([contract.id]);
|
||||||
if (isExist) {
|
if (isExist) {
|
||||||
updateChatSession({
|
updateChatSession({
|
||||||
...contract,
|
...contract,
|
||||||
|
|||||||
Reference in New Issue
Block a user