refactor(ui): 移除空壳行业资讯 Tab + Provider URL 去重
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

- SimpleSidebar: 移除空壳"行业资讯" Tab 和 Newspaper icon import
- ModelsAPI.tsx: AVAILABLE_PROVIDERS 引用 LLM_PROVIDER_URLS 常量
- models.ts: PROVIDER_DEFAULTS 引用 api-urls.ts,消除重复 URL 定义
- 所有 Provider URL 现在统一在 api-urls.ts 维护
This commit is contained in:
iven
2026-04-11 02:59:16 +08:00
parent 722d8a3a9e
commit 5e937d0ce2
3 changed files with 49 additions and 87 deletions

View File

@@ -6,6 +6,7 @@ import { useConfigStore } from '../../store/configStore';
import { useConversationStore } from '../../store/chat/conversationStore';
import { silentErrorHandler } from '../../lib/error-utils';
import { secureStorage } from '../../lib/secure-storage';
import { LLM_PROVIDER_URLS } from '../../constants/api-urls';
import { Plus, Pencil, Trash2, Star, Eye, EyeOff, AlertCircle, X, Zap, Check } from 'lucide-react';
// 自定义模型数据结构
@@ -41,17 +42,17 @@ interface EmbeddingProvider {
// P2-21: 外国模型 (OpenAI, Anthropic, Gemini) 暂停支持,标记为 suspended
const AVAILABLE_PROVIDERS = [
// === Coding Plan 专用端点 (推荐用于编程场景) ===
{ id: 'kimi-coding', name: 'Kimi Coding Plan', baseUrl: 'https://api.kimi.com/coding/v1' },
{ id: 'qwen-coding', name: '百炼 Coding Plan', baseUrl: 'https://coding.dashscope.aliyuncs.com/v1' },
{ id: 'zhipu-coding', name: '智谱 GLM Coding Plan', baseUrl: 'https://open.bigmodel.cn/api/coding/paas/v4' },
{ id: 'kimi-coding', name: 'Kimi Coding Plan', baseUrl: LLM_PROVIDER_URLS.KIMI_CODING },
{ id: 'qwen-coding', name: '百炼 Coding Plan', baseUrl: LLM_PROVIDER_URLS.QWEN_CODING },
{ id: 'zhipu-coding', name: '智谱 GLM Coding Plan', baseUrl: LLM_PROVIDER_URLS.ZHIPU_CODING },
// === 标准 API 端点 (国内) ===
{ id: 'kimi', name: 'Kimi (标准 API)', baseUrl: 'https://api.moonshot.cn/v1' },
{ id: 'zhipu', name: '智谱 (标准 API)', baseUrl: 'https://open.bigmodel.cn/api/paas/v4' },
{ id: 'qwen', name: '百炼/通义千问 (标准)', baseUrl: 'https://dashscope.aliyuncs.com/compatible-mode/v1' },
{ id: 'deepseek', name: 'DeepSeek', baseUrl: 'https://api.deepseek.com/v1' },
{ id: 'kimi', name: 'Kimi (标准 API)', baseUrl: LLM_PROVIDER_URLS.KIMI },
{ id: 'zhipu', name: '智谱 (标准 API)', baseUrl: LLM_PROVIDER_URLS.ZHIPU },
{ id: 'qwen', name: '百炼/通义千问 (标准)', baseUrl: LLM_PROVIDER_URLS.QWEN },
{ id: 'deepseek', name: 'DeepSeek', baseUrl: LLM_PROVIDER_URLS.DEEPSEEK },
// === 暂停支持 (P2-21: 前期不使用非国内大模型) ===
{ id: 'openai', name: 'OpenAI (暂停支持)', baseUrl: 'https://api.openai.com/v1', suspended: true },
{ id: 'anthropic', name: 'Anthropic (暂停支持)', baseUrl: 'https://api.anthropic.com', suspended: true },
{ id: 'openai', name: 'OpenAI (暂停支持)', baseUrl: LLM_PROVIDER_URLS.OPENAI, suspended: true },
{ id: 'anthropic', name: 'Anthropic (暂停支持)', baseUrl: LLM_PROVIDER_URLS.ANTHROPIC, suspended: true },
{ id: 'custom', name: '自定义', baseUrl: '' },
];