fix(provider): split partial model fetch warnings from errors

This commit is contained in:
zhefox
2026-05-26 17:45:06 +08:00
parent aa409a8a9c
commit 1173a4d9d5
14 changed files with 171 additions and 48 deletions
@@ -564,12 +564,11 @@ async function fetchUpstreamModels() {
const mergedCustom = new Set([...allCustomNames.value, ...customFromSelected])
allCustomNames.value = Array.from(mergedCustom).filter(name => !upstreamIds.has(name))
}
if (result.warning) {
showWarning(result.warning, '部分格式获取失败')
}
if (result.error) {
if (result.models.length > 0) {
showWarning(result.error, '部分格式获取失败')
} else {
showError(result.error, '获取上游模型失败')
}
showError(result.error, '获取上游模型失败')
}
} catch (err: unknown) {
showError(parseApiError(err, '获取上游模型列表失败'), '错误')