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 ef20330..389bdb6 100644 --- a/frontend/src/components/TitleBar.vue +++ b/frontend/src/components/TitleBar.vue @@ -12,6 +12,13 @@ 检测到更新 {{ updateInfo.latest_version }} 请尽快更新 + + 检测到更新后端有更新。请重启软件即可自动完成更新 + @@ -42,11 +49,11 @@