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:
29
src/services/api/authFiles.ts
Normal file
29
src/services/api/authFiles.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* 认证文件与 OAuth 排除模型相关 API
|
||||
*/
|
||||
|
||||
import { apiClient } from './client';
|
||||
import type { AuthFilesResponse } from '@/types/authFile';
|
||||
|
||||
export const authFilesApi = {
|
||||
list: () => apiClient.get<AuthFilesResponse>('/auth-files'),
|
||||
|
||||
upload: (file: File) => {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file, file.name);
|
||||
return apiClient.postForm('/auth-files', formData);
|
||||
},
|
||||
|
||||
deleteFile: (name: string) => apiClient.delete(`/auth-files?name=${encodeURIComponent(name)}`),
|
||||
|
||||
deleteAll: () => apiClient.delete('/auth-files', { params: { all: true } }),
|
||||
|
||||
// OAuth 排除模型
|
||||
getOauthExcludedModels: () => apiClient.get('/oauth-excluded-models'),
|
||||
|
||||
saveOauthExcludedModels: (provider: string, models: string[]) =>
|
||||
apiClient.patch('/oauth-excluded-models', { provider, models }),
|
||||
|
||||
deleteOauthExcludedEntry: (provider: string) =>
|
||||
apiClient.delete(`/oauth-excluded-models?provider=${encodeURIComponent(provider)}`)
|
||||
};
|
||||
Reference in New Issue
Block a user