fix: CTP登录冷却持久化到数据库,取消页面自动连并刷新JS缓存
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+2
-8
@@ -394,7 +394,6 @@
|
||||
return Promise.resolve({});
|
||||
}
|
||||
ctpConnectInflight = true;
|
||||
updateCtpBadge(false, true);
|
||||
return fetch('/api/ctp/connect', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
@@ -415,6 +414,7 @@
|
||||
return d;
|
||||
}
|
||||
if (d.connecting || st.connecting) {
|
||||
updateCtpBadge(false, true);
|
||||
return waitForCtpConnected(70000).then(function (ok) {
|
||||
if (!ok && d.error) showCtpError(d.error);
|
||||
else if (!ok && st.last_error) showCtpError(st.last_error);
|
||||
@@ -1086,13 +1086,7 @@
|
||||
var st = d.status || {};
|
||||
syncCtpBadgeFromStatus(st);
|
||||
if (st.last_error) showCtpError(st.last_error);
|
||||
if (st.connected) {
|
||||
pollPositions();
|
||||
return;
|
||||
}
|
||||
if ((st.login_cooldown_sec || 0) > 0) return;
|
||||
if (isCtpLoginBanError(st.last_error)) return;
|
||||
if (!st.connecting) requestCtpConnect(false);
|
||||
if (st.connected) pollPositions();
|
||||
})
|
||||
.catch(function () {});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user