fix: 矫正后端需要更新的逻辑
This commit is contained in:
@@ -43,13 +43,13 @@ async def get_git_version() -> VersionOut:
|
|||||||
code=500,
|
code=500,
|
||||||
status="error",
|
status="error",
|
||||||
message=f"{type(e).__name__}: {str(e)}",
|
message=f"{type(e).__name__}: {str(e)}",
|
||||||
if_latest=False,
|
if_need_update=False,
|
||||||
current_hash="",
|
current_hash="",
|
||||||
current_time="",
|
current_time="",
|
||||||
current_version="",
|
current_version="",
|
||||||
)
|
)
|
||||||
return VersionOut(
|
return VersionOut(
|
||||||
if_latest=is_latest,
|
if_need_update=not is_latest,
|
||||||
current_hash=commit_hash,
|
current_hash=commit_hash,
|
||||||
current_time=commit_time,
|
current_time=commit_time,
|
||||||
current_version=Config.version(),
|
current_version=Config.version(),
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class InfoOut(OutBase):
|
|||||||
|
|
||||||
|
|
||||||
class VersionOut(OutBase):
|
class VersionOut(OutBase):
|
||||||
if_latest: bool = Field(..., description="后端代码是否为最新")
|
if_need_update: bool = Field(..., description="后端代码是否需要更新")
|
||||||
current_hash: str = Field(..., description="后端代码当前哈希值")
|
current_hash: str = Field(..., description="后端代码当前哈希值")
|
||||||
current_time: str = Field(..., description="后端代码当前时间戳")
|
current_time: str = Field(..., description="后端代码当前时间戳")
|
||||||
current_version: str = Field(..., description="后端当前版本号")
|
current_version: str = Field(..., description="后端当前版本号")
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ export type VersionOut = {
|
|||||||
*/
|
*/
|
||||||
message?: string;
|
message?: string;
|
||||||
/**
|
/**
|
||||||
* 后端代码是否为最新
|
* 后端代码是否需要更新
|
||||||
*/
|
*/
|
||||||
if_latest: boolean;
|
if_need_update: boolean;
|
||||||
/**
|
/**
|
||||||
* 后端代码当前哈希值
|
* 后端代码当前哈希值
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
检测到更新 {{ updateInfo.latest_version }} 请尽快更新
|
检测到更新 {{ updateInfo.latest_version }} 请尽快更新
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
v-if="!backendUpdateInfo?.if_latest"
|
v-if="backendUpdateInfo?.if_need_update"
|
||||||
class="update-hint"
|
class="update-hint"
|
||||||
:title="getUpdateTooltip()"
|
:title="getUpdateTooltip()"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user