fix: 登录冷却期间不再显示 CTP 连接中,优化前端状态同步

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-25 16:57:06 +08:00
parent 4aebc2df49
commit 9c8b92d2bd
4 changed files with 77 additions and 14 deletions
+8
View File
@@ -1549,6 +1549,14 @@ def install_trading(app, *, login_required, require_nav, get_db, get_setting, se
"status": st,
"account": acc,
})
if info.get("cooldown"):
return jsonify({
"ok": False,
"cooldown": True,
"error": st.get("last_error") or "CTP 登录冷却中",
"status": st,
"account": acc,
}), 400
return jsonify({
"ok": False,
"error": st.get("last_error") or "CTP 连接未启动",