mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-03 11:20:50 +08:00
feat: initialize new React application structure with TypeScript, ESLint, and Prettier configurations, while removing legacy files and adding new components and pages for enhanced functionality
This commit is contained in:
19
src/services/api/apiKeys.ts
Normal file
19
src/services/api/apiKeys.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* API 密钥管理
|
||||
*/
|
||||
|
||||
import { apiClient } from './client';
|
||||
|
||||
export const apiKeysApi = {
|
||||
async list(): Promise<string[]> {
|
||||
const data = await apiClient.get('/api-keys');
|
||||
const keys = (data && (data['api-keys'] ?? data.apiKeys)) as unknown;
|
||||
return Array.isArray(keys) ? (keys as string[]) : [];
|
||||
},
|
||||
|
||||
replace: (keys: string[]) => apiClient.put('/api-keys', keys),
|
||||
|
||||
update: (index: number, value: string) => apiClient.patch('/api-keys', { index, value }),
|
||||
|
||||
delete: (index: number) => apiClient.delete(`/api-keys?index=${index}`)
|
||||
};
|
||||
Reference in New Issue
Block a user