Auto poll KDocs login status
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user