mod: 补充API KEY详情页进度条

This commit is contained in:
sczheng
2026-01-23 09:54:00 +08:00
parent 2180c42b84
commit c0c944f904
6 changed files with 158 additions and 27 deletions

View File

@@ -762,7 +762,7 @@ class ApiKeyService {
for (const key of apiKeys) {
key.usage = await redis.getUsageStats(key.id)
const costStats = await redis.getCostStats(key.id)
// Add cost information to usage object for frontend compatibility
// 为前端兼容性:把费用信息同步到 usage 对象里
if (key.usage && costStats) {
key.usage.total = key.usage.total || {}
key.usage.total.cost = costStats.total