feat(api): 模型接入 - 统一出网 User-Agent 并支持添加时测试模型

Fixes #39
This commit is contained in:
ddCat committed 2026-07-29 18:31:01 +08:00
1 parent 09f5ff03cc
commit 55875207c9
19 files changed
+348 -36

No files matched your search

+2 -2
View File
@@ -153,7 +153,7 @@ export default function SettingsPage() {
}
setChannelLoading(channel.id, true);
try {
const models = await fetchChannelModels(channel);
const models = await fetchChannelModels(channel, true);
if (!models.length) {
message.warning(`${channel.name || "当前渠道"}未返回模型,已保留现有手工模型`);
return;
@@ -190,7 +190,7 @@ export default function SettingsPage() {
const results = await Promise.all(
runnable.map(async (channel) => {
try {
const models = await fetchChannelModels(channel);
const models = await fetchChannelModels(channel, true);
return { channel, models, error: "" };
} catch (error) {
return { channel, models: [] as string[], error: error instanceof Error ? error.message : "读取失败" };