diff --git a/back/api/script.ts b/back/api/script.ts index 619404da..50679254 100644 --- a/back/api/script.ts +++ b/back/api/script.ts @@ -129,7 +129,7 @@ export default (app: Router) => { if (config.writePathList.every((x) => !path.startsWith(x))) { return res.send({ code: 430, - data: '文件路径禁止访问', + message: '文件路径禁止访问', }); } if (!originFilename) { diff --git a/back/public.ts b/back/public.ts index 8faf9e6d..d95497ae 100644 --- a/back/public.ts +++ b/back/public.ts @@ -10,7 +10,7 @@ app.get('/api/public/panel/log', (req, res) => { 'pm2 logs panel --lines 500 --nostream --timestamp', (err, stdout, stderr) => { if (err || stderr) { - return res.send({ code: 400, data: err || stderr }); + return res.send({ code: 400, message: (err && err.message) || stderr }); } return res.send({ code: 200, data: stdout }); }, diff --git a/back/services/system.ts b/back/services/system.ts index 8d84e738..79563309 100644 --- a/back/services/system.ts +++ b/back/services/system.ts @@ -52,7 +52,7 @@ export default class SystemService { }); return { code: 200, data: { ...result, code } }; } else { - return { code: 400, data: '通知发送失败,请检查参数' }; + return { code: 400, message: '通知发送失败,请检查参数' }; } } @@ -111,7 +111,7 @@ export default class SystemService { } catch (error: any) { return { code: 400, - data: error.message, + message: error.message, }; } } @@ -169,9 +169,9 @@ export default class SystemService { public async notify({ title, content }: { title: string; content: string }) { const isSuccess = await this.notificationService.notify(title, content); if (isSuccess) { - return { code: 200, data: '通知发送成功' }; + return { code: 200, message: '通知发送成功' }; } else { - return { code: 400, data: '通知发送失败,请检查参数' }; + return { code: 400, message: '通知发送失败,请检查系统设置/通知配置' }; } } } diff --git a/back/services/user.ts b/back/services/user.ts index db862690..aa260e46 100644 --- a/back/services/user.ts +++ b/back/services/user.ts @@ -346,7 +346,7 @@ export default class UserService { }); return { code: 200, data: { ...result, code } }; } else { - return { code: 400, data: '通知发送失败,请检查参数' }; + return { code: 400, message: '通知发送失败,请检查参数' }; } } } diff --git a/shell/update.sh b/shell/update.sh index 2fcebb9a..b3729202 100755 --- a/shell/update.sh +++ b/shell/update.sh @@ -531,8 +531,8 @@ main() { local diff_time=$(($(date +%s -d "$end_time") - $(date +%s -d "$begin_time"))) if [[ $p1 != "repo" ]] && [[ $p1 != "raw" ]]; then echo -e "\n## 执行结束... $end_time 耗时 $diff_time 秒" >>$log_path + cat $log_path fi - cat $log_path } main "$@" diff --git a/src/layouts/index.tsx b/src/layouts/index.tsx index 7cb4d830..ed09eb0c 100644 --- a/src/layouts/index.tsx +++ b/src/layouts/index.tsx @@ -101,7 +101,7 @@ export default function (props: any) { }; useEffect(() => { - if (systemInfo && systemInfo.isInitialized && !user) { + if (systemInfo && systemInfo.isInitialized && !user.username) { getUser(); } }, [props.location.pathname]); diff --git a/src/utils/http.ts b/src/utils/http.ts index ab87d5d0..dc1c2929 100644 --- a/src/utils/http.ts +++ b/src/utils/http.ts @@ -11,7 +11,7 @@ const time = Date.now(); const errorHandler = function (error: any) { if (error.response) { const msg = error.data - ? error.data.message || error.data + ? error.data.message || error.message || error.data : error.response.statusText; const responseStatus = error.response.status; if ([502, 504].includes(responseStatus)) {