From 91e734b094b62d85505c754bc80da667db0aa57f Mon Sep 17 00:00:00 2001 From: lyx <2027667395@qq.com> Date: Tue, 2 Apr 2024 15:02:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B6=88=E6=81=AF=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E5=B7=B2=E8=AF=BB=EF=BC=8C=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E4=B8=BA=E6=B8=85=E7=A9=BA=20fix=20#467?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/system/Notifications.tsx | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/packages/plugins/@hera/plugin-core/src/client/components/system/Notifications.tsx b/packages/plugins/@hera/plugin-core/src/client/components/system/Notifications.tsx index 5c9c94ebe..4f12b7497 100644 --- a/packages/plugins/@hera/plugin-core/src/client/components/system/Notifications.tsx +++ b/packages/plugins/@hera/plugin-core/src/client/components/system/Notifications.tsx @@ -16,12 +16,20 @@ export const Notifications = () => { url: `/system_notifications:get`, }); const getNotificationList = data?.data || []; - const { run: updateRead } = useRequest<{ data: any }>({ - url: `/system_notifications:update`, - params: { - ids: getNotificationList.map((item) => item.id), + const { run: updateRead } = useRequest<{ data: any }>( + { + url: `/system_notifications:update`, + params: { + ids: getNotificationList.map((item) => item.id), + }, }, - }); + { + onSuccess() { + run(); + message.info('成功'); + }, + }, + ); const content = ( { block onClick={() => { updateRead(); - run(); - message.info('成功'); }} > 全部已读