From 082874628167b10d9dc84d5375bea55b59576bd4 Mon Sep 17 00:00:00 2001 From: SunSeekerX Date: Sat, 6 Dec 2025 18:30:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20ESLint=20=E9=94=99?= =?UTF-8?q?=E8=AF=AF=20-=20if=20=E8=AF=AD=E5=8F=A5=E8=8A=B1=E6=8B=AC?= =?UTF-8?q?=E5=8F=B7=E5=92=8C=E7=AE=AD=E5=A4=B4=E5=87=BD=E6=95=B0=E7=AE=80?= =?UTF-8?q?=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/redis.js | 4 +++- src/routes/admin/apiKeys.js | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/models/redis.js b/src/models/redis.js index d0356ed8..5a39c1e9 100644 --- a/src/models/redis.js +++ b/src/models/redis.js @@ -795,7 +795,9 @@ class RedisClient { * 获取使用了指定模型的 Key IDs(OR 逻辑) */ async getKeyIdsWithModels(keyIds, models) { - if (!keyIds.length || !models.length) return new Set() + if (!keyIds.length || !models.length) { + return new Set() + } const client = this.getClientSafe() const result = new Set() diff --git a/src/routes/admin/apiKeys.js b/src/routes/admin/apiKeys.js index f9e38798..9a22cb50 100644 --- a/src/routes/admin/apiKeys.js +++ b/src/routes/admin/apiKeys.js @@ -474,9 +474,9 @@ async function getApiKeysSortedByCostCustom(options) { } // 2. 转换为数组并排序 - const sortedEntries = [...costs.entries()].sort((a, b) => { - return sortOrder === 'desc' ? b[1] - a[1] : a[1] - b[1] - }) + const sortedEntries = [...costs.entries()].sort((a, b) => + sortOrder === 'desc' ? b[1] - a[1] : a[1] - b[1] + ) const rankedKeyIds = sortedEntries.map(([keyId]) => keyId) // 3. 批量获取 API Key 基础数据