提交 1e604eab 作者: ZhangLingKun

功能:消息管理-客服消息问题修复

上级 e2957478
流水线 #9031 已通过 于阶段
in 1 分 2 秒
......@@ -10,6 +10,9 @@ type DataType = InterDataType<selectUserListType>;
// 列表类型
type ListType = InterListType<selectUserMessageType>;
// 定时任务
let getMessageTimer: NodeJS.Timer;
const MessageChatContentView: React.FC<{ currentData: DataType[0]; userAccountId: number }> = ({
currentData,
userAccountId,
......@@ -69,6 +72,12 @@ const MessageChatContentView: React.FC<{ currentData: DataType[0]; userAccountId
useEffect(() => {
if (!currentData?.userAccountId) return;
getMessageList().then();
getMessageTimer = setInterval(() => {
getMessageList().then();
}, 5000);
return () => {
clearInterval(getMessageTimer as any);
};
}, [currentData]);
// 消息列表副作用
useEffect(() => {
......
......@@ -31,6 +31,7 @@
height: 45px;
border-radius: 50%;
margin-right: 8px;
object-fit: fill;
}
.item-content {
......@@ -132,6 +133,7 @@
height: 40px;
border-radius: 50%;
margin-right: 10px;
object-fit: fill;
}
.title {
......
......@@ -13,6 +13,9 @@ import MessageChatSystemView from '~/pages/messageManage/messageChat/comp/messag
// 消息类型
type MessageType = InterDataType<selectUserListType>;
// 定时任务
let intervalTimer: NodeJS.Timer;
const MessageChatPage: React.FC = () => {
// 登录的用户信息
const { userInfo } = useSelector((state: any) => state.UserInfo);
......@@ -92,6 +95,12 @@ const MessageChatPage: React.FC = () => {
useEffect(() => {
if (isNull(userAccountId)) return;
getMessageList().then();
intervalTimer = setInterval(() => {
getMessageList().then();
}, 10000);
return () => {
clearInterval(intervalTimer as any);
};
}, [userAccountId]);
return (
<div className='message-chat flex-start'>
......
......@@ -1462,7 +1462,6 @@ export const routerList: Array<RouteObjectType> = [
id: 1400,
icon: <CommentOutlined />,
title: '消息管理',
develop: true,
},
children: [
{
......@@ -1473,7 +1472,6 @@ export const routerList: Array<RouteObjectType> = [
id: 1410,
title: '客服消息',
icon: <CommentOutlined />,
develop: true,
},
},
],
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论