Merge pull request 'fix: 消息通知点击已读,提示消息为清空 fix #467' (#568) from fix_system_record into dev

Reviewed-on: daoyoucloud/tachycode#568
This commit is contained in:
sealday 2024-04-02 16:47:15 +08:00
commit c2ea05e451

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('成功');
}} }}
> >