fix: 消息通知点击已读,提示消息为清空 fix #467

This commit is contained in:
lyx 2024-04-02 15:02:15 +08:00
parent dd38283c91
commit 91e734b094

View File

@ -16,12 +16,20 @@ export const Notifications = () => {
url: `/system_notifications:get`, url: `/system_notifications:get`,
}); });
const getNotificationList = data?.data || []; const getNotificationList = data?.data || [];
const { run: updateRead } = useRequest<{ data: any }>({ const { run: updateRead } = useRequest<{ data: any }>(
{
url: `/system_notifications:update`, url: `/system_notifications:update`,
params: { params: {
ids: getNotificationList.map((item) => item.id), ids: getNotificationList.map((item) => item.id),
}, },
}); },
{
onSuccess() {
run();
message.info('成功');
},
},
);
const content = ( const content = (
<List <List
style={{ width: '400px' }} style={{ width: '400px' }}
@ -33,8 +41,6 @@ export const Notifications = () => {
block block
onClick={() => { onClick={() => {
updateRead(); updateRead();
run();
message.info('成功');
}} }}
> >