From 86f8884e45d7c87f09abb03e85acdc843cd08385 Mon Sep 17 00:00:00 2001 From: AoXuan Date: Tue, 9 Sep 2025 21:28:14 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=E7=89=88=E6=9C=AC=E6=A3=80=E6=9F=A5=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=8F=8A=E6=9B=B4=E6=96=B0=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/TitleBar.vue | 58 +++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/TitleBar.vue b/frontend/src/components/TitleBar.vue index ef20330..270e355 100644 --- a/frontend/src/components/TitleBar.vue +++ b/frontend/src/components/TitleBar.vue @@ -12,6 +12,13 @@ 检测到更新 {{ updateInfo.latest_version }} 请尽快更新 + + 检测到更新后端有更新。请重启软件即可自动完成更新 + @@ -42,11 +49,11 @@ From 72375232372c93da83802918614f6de0136795ac Mon Sep 17 00:00:00 2001 From: AoXuan Date: Tue, 9 Sep 2025 21:40:46 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E9=80=BB=E8=BE=91=E5=86=99=E5=8F=8D?= =?UTF-8?q?=E4=BA=86=EF=BC=8C=E4=BF=AE=E5=A4=8D=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/TitleBar.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/TitleBar.vue b/frontend/src/components/TitleBar.vue index 270e355..a0cfbbe 100644 --- a/frontend/src/components/TitleBar.vue +++ b/frontend/src/components/TitleBar.vue @@ -13,7 +13,7 @@ 检测到更新 {{ updateInfo.latest_version }} 请尽快更新 @@ -63,7 +63,7 @@ const version = import.meta.env.VITE_APP_VERSION || '获取版本失败!' const updateInfo = ref(null) const backendUpdateInfo = ref(null) -const POLL_MS = 10 * 60 * 1000 // 10 分钟 +const POLL_MS = 1 * 60 * 1000 // 10 分钟 let pollTimer: number | null = null const polling = ref(false) From e3c0add012a42570a801f6c61ca8dd6e5037e2aa Mon Sep 17 00:00:00 2001 From: DLmaster361 Date: Tue, 9 Sep 2025 23:14:29 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E7=9F=AB=E6=AD=A3=E5=90=8E=E7=AB=AF?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E6=9B=B4=E6=96=B0=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/info.py | 4 ++-- app/models/schema.py | 2 +- frontend/src/api/models/VersionOut.ts | 4 ++-- frontend/src/components/TitleBar.vue | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/api/info.py b/app/api/info.py index a184a6e..0f91606 100644 --- a/app/api/info.py +++ b/app/api/info.py @@ -43,13 +43,13 @@ async def get_git_version() -> VersionOut: code=500, status="error", message=f"{type(e).__name__}: {str(e)}", - if_latest=False, + if_need_update=False, current_hash="", current_time="", current_version="", ) return VersionOut( - if_latest=is_latest, + if_need_update=not is_latest, current_hash=commit_hash, current_time=commit_time, current_version=Config.version(), diff --git a/app/models/schema.py b/app/models/schema.py index 827c683..d4f3d75 100644 --- a/app/models/schema.py +++ b/app/models/schema.py @@ -35,7 +35,7 @@ class InfoOut(OutBase): class VersionOut(OutBase): - if_latest: bool = Field(..., description="后端代码是否为最新") + if_need_update: bool = Field(..., description="后端代码是否需要更新") current_hash: str = Field(..., description="后端代码当前哈希值") current_time: str = Field(..., description="后端代码当前时间戳") current_version: str = Field(..., description="后端当前版本号") diff --git a/frontend/src/api/models/VersionOut.ts b/frontend/src/api/models/VersionOut.ts index ff9c990..fda87ef 100644 --- a/frontend/src/api/models/VersionOut.ts +++ b/frontend/src/api/models/VersionOut.ts @@ -16,9 +16,9 @@ export type VersionOut = { */ message?: string; /** - * 后端代码是否为最新 + * 后端代码是否需要更新 */ - if_latest: boolean; + if_need_update: boolean; /** * 后端代码当前哈希值 */ diff --git a/frontend/src/components/TitleBar.vue b/frontend/src/components/TitleBar.vue index a0cfbbe..389bdb6 100644 --- a/frontend/src/components/TitleBar.vue +++ b/frontend/src/components/TitleBar.vue @@ -13,7 +13,7 @@ 检测到更新 {{ updateInfo.latest_version }} 请尽快更新