diff --git a/back/api/user.ts b/back/api/user.ts index 9da8250a..cdb0eb61 100644 --- a/back/api/user.ts +++ b/back/api/user.ts @@ -74,6 +74,9 @@ export default (app: Router) => { async (req: Request, res: Response, next: NextFunction) => { const logger: Logger = Container.get('logger'); try { + if (process.env.DeployEnv === 'demo') { + return res.send({ code: 450, message: '未知错误' }); + } const userService = Container.get(UserService); await userService.updateUsernameAndPassword(req.body); res.send({ code: 200, message: '更新成功' }); diff --git a/src/locales/en-US.json b/src/locales/en-US.json index ca2d18de..b1bfcfb1 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -237,6 +237,7 @@ "系统将在": "The system will restart in", "秒后自动刷新": "seconds and automatically refresh", "检查更新": "Check for Updates", + "重新启动": "Reboot", "确认删除应用": "Confirm to delete the application", "确认重置": "Confirm to reset", "确认重置应用": "Confirm to reset the application", diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json index 90ecb834..d1eff815 100644 --- a/src/locales/zh-CN.json +++ b/src/locales/zh-CN.json @@ -237,6 +237,7 @@ "系统将在": "系统将在", "秒后自动刷新": "秒后自动刷新", "检查更新": "检查更新", + "重新启动": "重新启动", "确认删除应用": "确认删除应用", "确认重置": "确认重置", "确认重置应用": "确认重置应用", diff --git a/src/pages/setting/checkUpdate.tsx b/src/pages/setting/checkUpdate.tsx index bcf835f9..14571e2b 100644 --- a/src/pages/setting/checkUpdate.tsx +++ b/src/pages/setting/checkUpdate.tsx @@ -77,7 +77,11 @@ const CheckUpdate = ({ systemInfo }: any) => { > ), - content:
, + content: ( +{lastLog}
++ ), okText: intl.get('下载更新'), cancelText: intl.get('以后再说'), onOk() { @@ -102,10 +106,41 @@ const CheckUpdate = ({ systemInfo }: any) => { okButtonProps: { disabled: true }, title: intl.get('下载更新中...'), centered: true, - content:{lastLog} +
, + content: ( +{value}
++ ), }); }; + const reloadSystem = () => { + request + .put(`${config.apiPrefix}system/reload`, { type: 'system' }) + .then((_data: any) => { + message.success({ + content: ( + + {intl.get('系统将在')} +{value} +