From b31eab02d7092236e8f2fa724c9da5066b6526a7 Mon Sep 17 00:00:00 2001 From: whyour Date: Sun, 11 Feb 2024 22:04:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=87=8D=E5=90=AF=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/api/system.ts | 2 +- src/pages/setting/checkUpdate.tsx | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/back/api/system.ts b/back/api/system.ts index a221bc7f..33beddc4 100644 --- a/back/api/system.ts +++ b/back/api/system.ts @@ -216,7 +216,7 @@ export default (app: Router) => { '/reload', celebrate({ body: Joi.object({ - type: Joi.string().required(), + type: Joi.string().optional().allow('').allow(null), }), }), async (req: Request, res: Response, next: NextFunction) => { diff --git a/src/pages/setting/checkUpdate.tsx b/src/pages/setting/checkUpdate.tsx index 14571e2b..f42bc849 100644 --- a/src/pages/setting/checkUpdate.tsx +++ b/src/pages/setting/checkUpdate.tsx @@ -114,9 +114,9 @@ const CheckUpdate = ({ systemInfo }: any) => { }); }; - const reloadSystem = () => { + const reloadSystem = (type?: string) => { request - .put(`${config.apiPrefix}system/reload`, { type: 'system' }) + .put(`${config.apiPrefix}system/reload`, { type }) .then((_data: any) => { message.success({ content: ( @@ -150,7 +150,7 @@ const CheckUpdate = ({ systemInfo }: any) => { content: intl.get('系统安装包下载成功,确认重启'), okText: intl.get('重启'), onOk() { - reloadSystem(); + reloadSystem('system'); }, onCancel() { modalRef.current.update({ @@ -218,7 +218,11 @@ const CheckUpdate = ({ systemInfo }: any) => { -