mirror of
https://github.com/router-for-me/Cli-Proxy-API-Management-Center.git
synced 2026-02-02 10:50:49 +08:00
fix(api): use oauth model alias endpoints
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -81,8 +81,8 @@ export const authFilesApi = {
|
|||||||
|
|
||||||
// OAuth 模型映射
|
// OAuth 模型映射
|
||||||
async getOauthModelMappings(): Promise<Record<string, OAuthModelMappingEntry[]>> {
|
async getOauthModelMappings(): Promise<Record<string, OAuthModelMappingEntry[]>> {
|
||||||
const data = await apiClient.get('/oauth-model-mappings');
|
const data = await apiClient.get('/oauth-model-alias');
|
||||||
const payload = (data && (data['oauth-model-mappings'] ?? data.items ?? data)) as any;
|
const payload = (data && (data['oauth-model-alias'] ?? data.items ?? data)) as any;
|
||||||
if (!payload || typeof payload !== 'object') return {};
|
if (!payload || typeof payload !== 'object') return {};
|
||||||
const result: Record<string, OAuthModelMappingEntry[]> = {};
|
const result: Record<string, OAuthModelMappingEntry[]> = {};
|
||||||
Object.entries(payload).forEach(([channel, mappings]) => {
|
Object.entries(payload).forEach(([channel, mappings]) => {
|
||||||
@@ -105,10 +105,10 @@ export const authFilesApi = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
saveOauthModelMappings: (channel: string, mappings: OAuthModelMappingEntry[]) =>
|
saveOauthModelMappings: (channel: string, mappings: OAuthModelMappingEntry[]) =>
|
||||||
apiClient.patch('/oauth-model-mappings', { channel, mappings }),
|
apiClient.patch('/oauth-model-alias', { channel, mappings }),
|
||||||
|
|
||||||
deleteOauthModelMappings: (channel: string) =>
|
deleteOauthModelMappings: (channel: string) =>
|
||||||
apiClient.delete(`/oauth-model-mappings?channel=${encodeURIComponent(channel)}`),
|
apiClient.delete(`/oauth-model-alias?channel=${encodeURIComponent(channel)}`),
|
||||||
|
|
||||||
// 获取认证凭证支持的模型
|
// 获取认证凭证支持的模型
|
||||||
async getModelsForAuthFile(name: string): Promise<{ id: string; display_name?: string; type?: string; owned_by?: string }[]> {
|
async getModelsForAuthFile(name: string): Promise<{ id: string; display_name?: string; type?: string; owned_by?: string }[]> {
|
||||||
|
|||||||
Reference in New Issue
Block a user