refactor: 重构上游模型获取与展示逻辑

- 后端支持遍历所有活跃 API Key 聚合模型,按 model id 合并 api_formats
- 前端移除按 API 格式分组,改为统一展示并内联显示格式标签
- 改进 401 错误处理,账户异常时清除认证并重定向首页
This commit is contained in:
fawney19
2026-01-29 22:58:37 +08:00
parent 297da59448
commit 61abb47d22
7 changed files with 262 additions and 162 deletions
@@ -264,7 +264,8 @@ import {
import { useToast } from '@/composables/useToast'
import {
type Model,
type ProviderModelAlias
type ProviderModelAlias,
type UpstreamModel,
} from '@/api/endpoints'
import { updateModel } from '@/api/endpoints/models'
import { useUpstreamModelsCache } from '../composables/useUpstreamModelsCache'
@@ -311,7 +312,7 @@ const searchQuery = ref('')
const collapsedGroups = ref<Set<string>>(new Set())
// 上游模型
const upstreamModels = ref<{ id: string; api_format?: string }[]>([])
const upstreamModels = ref<UpstreamModel[]>([])
// 表单数据
const formData = ref<{