fix: 修复 AILogo 噪音、设置页滚动与供应商批量伪内置脏数据

- AILogo: `custom` 名称为合法兜底场景,不再以 console.error 上报;其余未匹配名称降级为 console.warn
- SettingPage/Model: 双栏加 `min-h-0 overflow-y-auto`,让供应商列表与右侧表单各自可滚动
- ProviderService.add_provider: API 创建一律落到 `type='custom'`,并对同名供应商抛 ValueError,避免再产生伪内置行
- CLAUDE.md: 补充 v2.0.0 子系统(RAG/Chat、可选 Nacos+RabbitMQ、i18n、cookie/transcriber 管理器)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
huangjianwu
2026-05-07 11:10:15 +08:00
parent 2cd43770eb
commit 108ad270bf
5 changed files with 35 additions and 13 deletions

View File

@@ -71,11 +71,19 @@ class ProviderService:
@staticmethod
def add_provider( name: str, api_key: str, base_url: str, logo: str, type_: str, enabled: int = 1):
try:
# 内置供应商type='built-in')只能由 seed 流程写入API 创建一律落到 'custom'
# 否则历史上出现过批量伪内置脏数据
if type_ != 'custom':
type_ = 'custom'
existing = get_provider_by_name(name)
if existing is not None:
raise ValueError(f'供应商名称已存在: {name}')
id = uuid().lower()
logo='custom'
logo = 'custom'
return insert_provider(id, name, api_key, base_url, logo, type_, enabled)
except Exception as e:
print('创建模式失败',e)
raise
@staticmethod
def provider_to_dict(p: Provider):
return {