feat: 支持账号维度的数据统计

This commit is contained in:
shaw
2025-09-27 22:55:06 +08:00
parent 5e730db7f9
commit ea28222c71
7 changed files with 1661 additions and 9 deletions

View File

@@ -497,6 +497,9 @@ class ClaudeAccountService {
schedulable: account.schedulable !== 'false', // 默认为true兼容历史数据
// 添加自动停止调度设置
autoStopOnWarning: account.autoStopOnWarning === 'true', // 默认为false
// 添加5小时自动停止状态
fiveHourAutoStopped: account.fiveHourAutoStopped === 'true',
fiveHourStoppedAt: account.fiveHourStoppedAt || null,
// 添加统一User-Agent设置
useUnifiedUserAgent: account.useUnifiedUserAgent === 'true', // 默认为false
// 添加统一客户端标识设置
@@ -2333,7 +2336,7 @@ class ClaudeAccountService {
for (const account of accounts) {
// 只检查因5小时限制被自动停止的账号
// 重要不恢复手动停止的账号没有fiveHourAutoStopped标记的
if (account.fiveHourAutoStopped === 'true' && account.schedulable === 'false') {
if (account.fiveHourAutoStopped === true && account.schedulable === false) {
result.checked++
// 使用分布式锁防止并发修改