fix(vfd): use isApMode() instead of hasInternet() to decide AP vs Err0

Made-with: Cursor
This commit is contained in:
stswangzhiping
2026-03-19 23:45:16 +08:00
parent 8f158eeeb2
commit c13ed3ba6d
2 changed files with 7 additions and 3 deletions

View File

@@ -163,10 +163,11 @@ class ClawClient {
this._wsFailCount++;
log.warn('clawd', `连接断开 (${code}),失败次数=${this._wsFailCount}${this._backoff / 1000}s 后重连...`);
if (this._hasEverConnected && this._wsFailCount >= 3) {
if (hasInternet()) {
led.display.showErr0(); // 有网但 VPS 不可达
const inAp = this._provisionMgr && this._provisionMgr.isApMode();
if (inAp || !hasInternet()) {
led.display.showAP(); // AP 模式 或 无网
} else {
led.display.showAP(); // 无网AP 模式
led.display.showErr0(); // STA 模式 + 有网 但 VPS 不可达
}
}
setTimeout(() => this._connect(), this._backoff);