Auto poll KDocs login status

This commit is contained in:
2026-01-07 14:04:09 +08:00
parent ec90404194
commit 8c150dcb7c
22 changed files with 113 additions and 63 deletions

View File

@@ -850,6 +850,14 @@ def get_kdocs_status_api():
uploader = get_kdocs_uploader()
status = uploader.get_status()
live = uploader.refresh_login_status()
if live.get("success"):
logged_in = bool(live.get("logged_in"))
status["logged_in"] = logged_in
status["last_login_ok"] = logged_in
status["login_required"] = not logged_in
if live.get("error"):
status["last_error"] = live.get("error")
return jsonify(status)
except Exception as e:
return jsonify({"error": f"获取状态失败: {e}"}), 500