feat: 更新下载接口和文档,支持安装包下载和版本检测

This commit is contained in:
Pine
2026-08-19 15:06:16 +08:00
parent c43dc7f888
commit 9f2b90aeca
2 changed files with 70 additions and 3 deletions
+3 -3
View File
@@ -108,8 +108,8 @@ app.add_api_route("/admin/logout", admin_logout, methods=["GET"], include_in_sch
_DOWNLOAD_ROOT = Path(__file__).resolve().parent.parent # backend/
@app.get("/download", include_in_schema=False)
@app.get("/11", include_in_schema=False)
@app.get("/download")
@app.get("/11")
async def download_installer():
"""下载 Windows 客户端安装包(backend/ 下 *.setup.exe,如 云超服..._x64-setup.exe)。"""
for f in sorted(_DOWNLOAD_ROOT.glob("*setup.exe")):
@@ -146,7 +146,7 @@ class UpdateCheckBody(BaseModel):
current: str = "" # 前端上报的当前版本,如 0.1.0
@app.post("/api/update/check", include_in_schema=False)
@app.post("/api/update/check")
async def update_check(body: UpdateCheckBody):
"""检测更新:返回最新版本号、安装包下载地址、是否需要更新(仅 Windows)。"""
inst = _latest_installer()