feat: 改进5xx错误熔断机制和重置状态功能

## 熔断机制优化
- 将5xx错误阈值从3次提升到10次,减少误触发
- 缩短临时错误恢复时间从60分钟到5分钟
- 支持所有5xx状态码(500-599)的统一处理

## 重置状态功能完善
后端 resetAccountStatus 新增清除:
- tempErrorAt 字段 (temp_error状态)
- sessionWindowStart/sessionWindowEnd 字段
- 5xx_errors Redis计数键

前端优化:
- 重置成功后强制刷新 loadAccounts(true)
- 避免缓存导致的状态显示不一致

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
sczheng189
2025-09-01 21:39:39 +08:00
parent f4f88091c1
commit f2c2bdf6d6
3 changed files with 12 additions and 4 deletions

View File

@@ -1323,7 +1323,8 @@ const resetAccountStatus = async (account) => {
if (data.success) {
showToast('账户状态已重置', 'success')
loadAccounts()
// 强制刷新,绕过前端缓存,确保最终一致性
loadAccounts(true)
} else {
showToast(data.message || '状态重置失败', 'error')
}