feat(ckbox): 添加更新微信好友配置的API和调用
在聊天会话初始化时调用updateConfig API更新好友配置,标记为可聊天状态
This commit is contained in:
@@ -22,6 +22,11 @@ export function WechatGroup(params) {
|
||||
export function clearUnreadCount(params) {
|
||||
return request("/api/WechatFriend/clearUnreadCount", params, "PUT");
|
||||
}
|
||||
|
||||
//更新配置
|
||||
export function updateConfig(params) {
|
||||
return request("/api/WechatFriend/updateConfig", params, "PUT");
|
||||
}
|
||||
//获取聊天记录-2 获取列表
|
||||
export function getChatMessages(params: {
|
||||
wechatAccountId: number;
|
||||
|
||||
@@ -10,7 +10,7 @@ import styles from "./index.module.scss";
|
||||
import { addChatSession } from "@/store/module/ckchat/ckchat";
|
||||
const { Header, Content, Sider } = Layout;
|
||||
import { chatInitAPIdata, initSocket } from "./main";
|
||||
import { clearUnreadCount } from "@/pages/pc/ckbox/api";
|
||||
import { clearUnreadCount, updateConfig } from "@/pages/pc/ckbox/api";
|
||||
import {
|
||||
KfUserListData,
|
||||
weChatGroup,
|
||||
@@ -82,6 +82,10 @@ const CkboxPage: React.FC = () => {
|
||||
contract.unreadCount = 0;
|
||||
addChatSession(contract);
|
||||
setCurrentChat(contract);
|
||||
updateConfig({
|
||||
id: contract.id,
|
||||
config: { chat: true },
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user