mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-23 09:38:02 +00:00
fix: 修复apikeys页面部分bug
This commit is contained in:
@@ -315,14 +315,21 @@ class RedisClient {
|
||||
})
|
||||
}
|
||||
|
||||
// 搜索(apiKey 模式在这里处理,bindingAccount 模式在路由层处理)
|
||||
if (search && searchMode === 'apiKey') {
|
||||
// 搜索
|
||||
if (search) {
|
||||
const lowerSearch = search.toLowerCase().trim()
|
||||
filteredKeys = filteredKeys.filter(
|
||||
(k) =>
|
||||
(k.name && k.name.toLowerCase().includes(lowerSearch)) ||
|
||||
(k.ownerDisplayName && k.ownerDisplayName.toLowerCase().includes(lowerSearch))
|
||||
)
|
||||
if (searchMode === 'apiKey') {
|
||||
// apiKey 模式:搜索名称和拥有者
|
||||
filteredKeys = filteredKeys.filter(
|
||||
(k) =>
|
||||
(k.name && k.name.toLowerCase().includes(lowerSearch)) ||
|
||||
(k.ownerDisplayName && k.ownerDisplayName.toLowerCase().includes(lowerSearch))
|
||||
)
|
||||
} else if (searchMode === 'bindingAccount') {
|
||||
// bindingAccount 模式:直接在Redis层处理,避免路由层加载10000条
|
||||
const accountNameCacheService = require('../services/accountNameCacheService')
|
||||
filteredKeys = accountNameCacheService.searchByBindingAccount(filteredKeys, lowerSearch)
|
||||
}
|
||||
}
|
||||
|
||||
// 4. 排序
|
||||
|
||||
Reference in New Issue
Block a user