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
+3 -1
View File
@@ -251,10 +251,12 @@ class CtpBridge:
self.ping()
st = _setting_for_mode(mode)
missing = [k for k in ("用户名", "密码", "交易服务器") if not st.get(k)]
cooldown = self.login_cooldown_remaining()
connecting = bool(self._connect_in_progress and cooldown <= 0)
return {
"vnpy_installed": self.available(),
"connected": self._connected_mode == mode,
"connecting": self._connect_in_progress,
"connecting": connecting,
"connected_mode": self._connected_mode,
"mode_label": _mode_label(mode),
"missing_config": missing,