fix(api): use oauth model alias endpoints

This commit is contained in:
hkfires
2026-01-16 09:13:38 +08:00
parent a44257edda
commit 99c4fbc30d
2 changed files with 749 additions and 749 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -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 }[]> {