From 50bf467341587ba7ffa0f921cd5426e269cb9693 Mon Sep 17 00:00:00 2001 From: JefferyHcool <1063474837@qq.com> Date: Fri, 20 Jun 2025 13:44:48 +0800 Subject: [PATCH] =?UTF-8?q?refactor(backend):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=88=9D=E5=A7=8B=E5=8C=96=E5=92=8C=E5=81=A5?= =?UTF-8?q?=E5=BA=B7=E6=A3=80=E6=9F=A5=E7=9B=B8=E5=85=B3=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新 BackendInitDialog 组件中的提示信息,增加报错提示 - 在 config 路由中添加 sys_check 接口,用于系统检查 - 修改 useCheckBackend钩子,使用新的 sys_check接口进行系统检查 --- BillNote_frontend/src/components/BackendInitDialog.tsx | 2 +- BillNote_frontend/src/hooks/useCheckBackend.ts | 2 +- backend/app/routers/config.py | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/BillNote_frontend/src/components/BackendInitDialog.tsx b/BillNote_frontend/src/components/BackendInitDialog.tsx index 09bd60a..989888f 100644 --- a/BillNote_frontend/src/components/BackendInitDialog.tsx +++ b/BillNote_frontend/src/components/BackendInitDialog.tsx @@ -15,7 +15,7 @@ interface Props { 后端正在初始化中… -
请稍候,系统正在启动后端服务
+请稍候,系统正在启动后端服务,出现报错属于正常现象
) diff --git a/BillNote_frontend/src/hooks/useCheckBackend.ts b/BillNote_frontend/src/hooks/useCheckBackend.ts index 52f0c7d..f05ce70 100644 --- a/BillNote_frontend/src/hooks/useCheckBackend.ts +++ b/BillNote_frontend/src/hooks/useCheckBackend.ts @@ -13,7 +13,7 @@ export const useCheckBackend = () => { const check = async () => { try { - await request.get('/sys_health') + await request.get('/sys_check') setInitialized(true) setLoading(false) } catch { diff --git a/backend/app/routers/config.py b/backend/app/routers/config.py index 8a43df0..350f104 100644 --- a/backend/app/routers/config.py +++ b/backend/app/routers/config.py @@ -39,3 +39,7 @@ async def sys_health(): return R.success() except EnvironmentError: return R.error(msg="系统未安装 ffmpeg 请先进行安装") + +@router.get("/sys_check") +async def sys_check(): + return R.success() \ No newline at end of file