fix(provider): support unversioned API roots in model fetch

This commit is contained in:
zhefox
2026-05-26 15:39:56 +08:00
parent c4927162b7
commit d28a389a93
11 changed files with 525 additions and 41 deletions
@@ -395,7 +395,7 @@ const emit = defineEmits<{
saved: []
}>()
const { success, error: showError } = useToast()
const { success, error: showError, warning: showWarning } = useToast()
const { confirmWarning } = useConfirm()
const { fetchModels: fetchCachedModels } = useUpstreamModelsCache()
@@ -691,6 +691,9 @@ async function fetchUpstreamModels(forceRefresh = false) {
// 获取上游模型后,从自定义模型列表中移除已变成已知的模型
const upstreamIds = new Set(result.models.map((m: UpstreamModel) => m.id))
allCustomModels.value = allCustomModels.value.filter(m => !upstreamIds.has(m))
if (result.error) {
showWarning(result.error, '部分格式获取失败')
}
} else if (result.error) {
showError(result.error, '获取上游模型失败')
}