mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 09:20:22 +08:00
feat(keys): 新增 Provider Keys 批量删除 API
- 后端新增 POST /keys/batch-delete 接口,支持一次删除最多 100 个 Key - 按 provider_id 聚合执行副作用,避免逐个删除导致的重复 Redis 操作 - 前端批量操作对话框中删除操作改用批量 API,按 100 个一批分批调用
This commit is contained in:
@@ -83,6 +83,20 @@ export async function deleteEndpointKey(keyId: string): Promise<{ message: strin
|
||||
return response.data
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除 Keys
|
||||
*/
|
||||
export interface BatchDeleteKeysResult {
|
||||
success_count: number
|
||||
failed_count: number
|
||||
failed: Array<{ id: string; error: string }>
|
||||
}
|
||||
|
||||
export async function batchDeleteEndpointKeys(ids: string[]): Promise<BatchDeleteKeysResult> {
|
||||
const response = await client.post('/api/admin/endpoints/keys/batch-delete', { ids })
|
||||
return response.data
|
||||
}
|
||||
|
||||
|
||||
// ========== Provider 级别的 Keys API ==========
|
||||
|
||||
|
||||
Reference in New Issue
Block a user