diff --git a/back/services/user.ts b/back/services/user.ts index cfc9d4ac..d60303f0 100644 --- a/back/services/user.ts +++ b/back/services/user.ts @@ -395,10 +395,10 @@ export default class UserService { ...result, }, }; - } catch (error) { + } catch (error: any) { return { code: 400, - data: '获取版本文件失败', + data: error.message, }; } } diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index 35241448..0c8968e0 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -91,38 +91,6 @@ export default function (props: any) { } }; - const showNewVersionModal = () => { - Modal.confirm({ - width: 500, - title: ( - <> -
更新可用
-
- 新版本5.8.0 (1780)可用。你使用的版本为{version}。 -
- - ), - content: ( -
-          {changeLog}
-        
- ), - okText: '更新', - cancelText: '以后再说', - onOk() { - console.log('ok'); - }, - }); - }; - useEffect(() => { vhCheck(); }, []); @@ -211,39 +179,26 @@ export default function (props: any) { title={ <> 控制面板 - - { + e.stopPropagation(); + }} + > + - { - e.stopPropagation(); - }} - > - - v{version} - - - - + v{version} + + } menuItemRender={(menuItemProps: any, defaultDom: any) => { diff --git a/src/pages/setting/checkUpdate.tsx b/src/pages/setting/checkUpdate.tsx index c5c3b60e..4a62272a 100644 --- a/src/pages/setting/checkUpdate.tsx +++ b/src/pages/setting/checkUpdate.tsx @@ -20,10 +20,14 @@ const CheckUpdate = ({ ws }: any) => { .then((_data: any) => { message.destroy(); const { code, data } = _data; - if (code === 200 && data.hasNewVersion) { - showConfirmUpdateModal(data); + if (code === 200) { + if (data.hasNewVersion) { + showConfirmUpdateModal(data); + } else { + message.success('已经是最新版了!'); + } } else { - message.success('已经是最新版了!'); + message.error(data); } }) .catch((error: any) => {