fengsilin
3e86f523db
feat(playground): temperature/top_p 参数互斥设置
部分上游模型不允许同时设置 temperature 和 top_p,新增管理员可配置的
模型前缀列表,匹配的模型在 Playground 中自动互斥切换两个参数。
- 后端新增 PlaygroundSetting 配置 + GET /api/playground/config 公开端点
- 运营设置页面新增 Playground 互斥模型前缀编辑 textarea
- Playground 自动检测模型名匹配,启用一个参数自动禁用另一个
- 默认包含 deepseek-v4-flash/pro、deepseek-reasoner、o1-/o3-/o4-、gpt-5
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
4 дней назад
fengsilin
d26ad9e635
feat: 渠道-模型级联选择 + 隐藏首页统计卡片
- UserRatioSection 模型输入改为级联下拉,选渠道后自动加载模型列表
- models 信息嵌入 channelOptions 消除冗余 channelMap 状态
- 注释掉首页 HeroSection 统计数据卡片
Co-Authored-By: Claude <noreply@anthropic.com>
5 дней назад
fengsilin
73d10b5799
feat: 错误日志记录上游 request-id 和响应体,Playground 渠道路由改为 header 传递
- 错误日志新增 upstream_request_id(从 Anthropic/OpenAI 响应 header 提取)和 upstream_body(截断 2KB)
- 修复 RelayErrorHandler 内部 WithOpenAIError/NewOpenAIError 分支丢失上游字段的 bug
- Playground 渠道和分组改为通过 X-Channel-Id/X-Group header 传递,而非 body 字段
- Distributor 中间件支持从 header 回退读取 channel_id 和 group
Co-Authored-By: Claude <noreply@anthropic.com>
2 недель назад
fengsilin
8bb2883d7e
feat(home): 首页定价卡片添加"去体验"按钮,跳转 Playground
- PricingCardView 新增 showTryButton 属性,点击跳转 Playground 并预选模型
- 移除 PricingCardView 中未使用的 props (selectedGroup, currency 等)
- 首页页脚路由重命名: terms→user-agreement, usage-policy→privacy-policy
- i18n: "操练场"更名为"对话"
Co-Authored-By: Claude <noreply@anthropic.com>
2 недель назад
fengsilin
74cc8c0d56
feat(playground): 添加渠道选择功能,支持指定渠道体验模型
- 新增 /api/user/model_channels 接口,返回模型可用渠道及默认渠道
- Playground 设置面板添加渠道选择下拉框
- Distribute 中间件支持从请求体读取 channel_id 指定渠道
- 支持 URL 参数 ?model=xxx 直接选择模型
Co-Authored-By: Claude <noreply@anthropic.com>
2 недель назад
fengsilin
967309fb56
feat: 添加邮箱后缀注册额度规则功能
管理员可在用户管理页面配置「邮箱后缀→初始额度」映射规则,
用户注册时根据邮箱后缀自动匹配并发放对应额度(替代默认额度)。
- 新增 email_quota_rule 数据表 + CRUD API(管理员权限)
- 内存缓存匹配,启动时加载,增删改时刷新
- 注册流程 Insert/InsertWithTx/FinalizeOAuthUserCreation 同步支持
- 前端用户管理页新增 Tab 展示规则管理卡片
- 含 24 个测试(model 16 + controller 8)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2 недель назад
fengsilin
20163dbad5
fix(legal): 法律文档页面切换语言时强制重新加载内容
给 DocumentRenderer 添加 key={lang} 属性,确保切换语言时组件
重新挂载并从 API 获取对应语言的内容,而非使用缓存内容。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2 недель назад
fengsilin
934b4b10a7
feat: 法律文档双语配置(中/英)+ 精简语言支持至中英双语
- LegalSettings 字段拆分为 _zh/_en 双语对
- API 支持 ?lang= 参数返回对应语言内容
- 后台设置页每个文档配语言切换按钮(中文/English)
- 前端页面根据 UI 语言自动请求对应内容
- 移除 fr/ru/ja/vi/zh-TW 语言支持
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2 недель назад
fengsilin
1cc75aa9a2
feat: 服务条款和使用政策页面,支持后台 Markdown 配置
复用现有 LegalSettings 模式,新增 TermsOfService 和 UsagePolicy 字段,
添加 /terms 和 /usage-policy 前端页面及 API 端点。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2 недель назад
fengsilin
518f1ab87f
refactor(frontend): 移除拖拽排序,改为 sort_order 数值输入
回退 @dnd-kit 拖拽实现,改为在编辑弹窗中直接设置 sort_order 数值:
- 模型编辑弹窗新增「排序」InputNumber 字段
- 供应商编辑弹窗新增「排序」InputNumber 字段
- 模型表格新增 sort_order 显示列
- 移除 @dnd-kit 依赖及所有 DnD 相关代码
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2 недель назад
fengsilin
65880fc69b
feat(frontend): Vendor Tab 和 Model 表格支持拖拽排序,移除定价页字母排序
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2 недель назад
fengsilin
e507897f21
feat(pricing): updatePricing 按 sort_order 排序 vendors 和 models
- vendorsList 按 vendor.SortOrder 升序排列,相同则按 ID 排序
- pricingMap 按 model.SortOrder 升序排列,相同则按模型名字典序
- 修复默认通道设置的 API 错误响应未正确展示的问题
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2 недель назад
fengsilin
3a29f3772f
feat(channel): 添加模型默认通道功能,支持优先路由和卡片标识
- 新增 is_default 字段和缓存层,支持管理员为模型指定默认通道
- Distribute 中间件优先级调整:Token 指定 → 默认通道 → 亲和性 → 随机
- 模型定价卡片和详情弹窗展示默认通道 amber 标识
- 管理后台定价页面新增星标切换默认通道
- 新增 set_default / clear_default API 和 6 个单元测试
- 简化卡片价格显示(移除内联缓存价格,改为详情弹窗展示)
Co-Authored-By: Claude <noreply@anthropic.com>
2 недель назад
fengsilin
93e331b624
feat: 支持 LOGO_FILE_PATH 环境变量指定本地 Logo,优化定价与语言设置
- 新增 LOGO_FILE_PATH 环境变量,优先级高于数据库配置,支持本地文件服务
- 渠道定价高级字段(缓存/图片/音频)不再回退全局默认值,未设置直接返回 0
- 缓存价格单位从表头移到具体价格值,新增渠道 ID 复制功能
- 修复默认语言在用户已有偏好时仍被覆盖的问题
- img 标签统一添加 referrerPolicy/crossOrigin 防止跨域问题
- 新增缓存倍率和最小余额阈值的详细说明文本
Co-Authored-By: Claude <noreply@anthropic.com>
3 недель назад
fengsilin
94f24b29f7
style: 首页文案"全球"改为"顶级"
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
3 недель назад
fengsilin
387f6c1ae0
feat(pricing): 定价数据源切换到渠道表,新增缓存价格展示
- 后端 pricing API 从 channel_pricings 表获取实际定价,选取最便宜渠道
- 提取 applyGlobalDefault 辅助函数消除全局回退逻辑重复
- price.go 重构扩展比率为局部变量,简化回退逻辑
- 定价卡片新增缓存读取/创建价格,改为两行布局防止溢出
- ChannelPricingCard 缓存列显示实际价格而非倍率
- 修复移动端 hero 区域 padding 过大
- 默认标签页标题改为 Loading...
- 新增缓存读取/创建 i18n 翻译(7 语言)
Co-Authored-By: Claude <noreply@anthropic.com>
3 недель назад
fengsilin
8d22c4e80e
style(home): 临时隐藏首页工具链/核心价值/工作流/生态伙伴 section
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3 недель назад
fengsilin
235f7c6e5f
refactor(channel-pricing): 提取 ParseTagIds 辅助函数 + 移除调试 console.log
- 将 tag ID 解析逻辑提取为 model.ParseTagIds,消除 model 层和 controller 层重复代码
- 统一 TrimSpace 处理(之前 controller 版本漏了)
- 移除 ChannelPricingView 残留的 console.log('Expanded keys:')
- 删除多余空行
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3 недель назад
fengsilin
129e17ac42
feat(channel-pricing): 前端支持缓存/图片/音频倍率编辑和展示
- ChannelPricingView.jsx: initValues 添加 5 个高级比例字段 + 按量计费模式下新增高级比例表单区块
- ChannelPricingCard.jsx: tableData 映射 cache_ratio/cache_creation_ratio + 条件列展示
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3 недель назад
fengsilin
e8ade3abae
feat(payment): 集成支付宝当面付扫码支付 + 补全前端 i18n 硬编码中文
支付宝支付:
- 后端:新增 topup_alipay.go、payment_alipay.go,实现当面付(扫码支付)下单、
回调验签、订单状态查询完整流程,支持 RSA2 签名
- 前端:新增 QRCodePayModal 通用二维码支付弹窗(泛化微信支付弹窗)、
SettingsPaymentGatewayAlipay 管理配置页面、充值流程接入支付宝
- 充值历史:管理员视图新增用户邮箱列,后端 fillTopUpEmails 批量填充
i18n 补全:
- 54 个缺失翻译 key 添加到全部 7 个 locale 文件(zh-CN/zh-TW/en/fr/ja/ru/vi)
- 涵盖渠道名称、仪表盘标签、兑换码状态、控制台时间筛选、Playground 错误消息、
Dashboard 设置页面提示等
- 14 个源码文件中约 31 处 showError/showSuccess/showWarning 硬编码中文改用 t()
- ChannelsColumnDefs、helpers、services 中散落的硬编码中文统一国际化
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3 недель назад
fengsilin
befde35afa
feat(i18n): 全面国际化前端硬编码中文文本
将 14 个源码文件中的硬编码中文 UI 文本统一包裹到 t()/i18n.t() 调用,
覆盖登录注册、首页、设置页、工具函数等核心模块,并为 7 个语言文件
补充约 80+ 翻译键;修复 zh-CN.json 值误用繁体问题。
Co-Authored-By: Claude <noreply@anthropic.com>
4 недель назад
fengsilin
00e266cd77
feat(payment): 集成微信支付 Native(扫码支付)V3 API
完整实现微信支付充值和订阅购买功能,支持配置热更新、二维码扫码支付、
回调验签、订单状态轮询,以及管理后台支付网关设置。
后端:
- 新增微信支付 V3 客户端(支持 Base64/文件路径两种密钥加载)
- Native 下单、回调处理、订单状态查询 API
- 充值订单幂等完成(事务+行锁)
- 订阅购买支持微信支付
- 配置变更自动重置客户端
- 提取 createWechatNativeOrder 消除重复下单逻辑
前端:
- 二维码扫码弹窗(含倒计时、自动轮询状态)
- 微信支付设置页面(AppID、商户号、密钥等 12 项配置)
- 充值页集成微信支付流程
依赖:go-pay/gopay v1.5.117
Co-Authored-By: Claude <noreply@anthropic.com>
1 месяц назад
fengsilin
296edf0f71
fix: 移植上游关键 bug 修复
从 QuantumNous/new-api 上游移植以下修复:
- fix(ssrf): 加固视频代理和 MJ 图片代理的 SSRF 防护,FetchModels 提权至 RootAuth
- fix(claude): 流式断流时不再整份覆盖 usage,保留 cache 计费字段
- fix(pricing): 定价接口增加用户可用分组过滤
- fix(ratio): compact 模型优先匹配精确定价再回退通配符
- fix(ali): 接受 task polling 返回的字符串类型 usage 值
- fix(gemini): 从 URL 路径 :streamGenerateContent 检测流式请求
- fix(zhipu_4v): coding plan 图片生成使用正确的 OpenAI endpoint
- fix(openai): MessageImageUrl.Detail 字段添加 omitempty
- fix(channel-affinity): skip_retry_on_failure 配置项为 false 时不再丢失
- fix(document-renderer): 使用 useMemo 替代 useState 处理 HTML payload
- fix(fetch-setting): ApplyIPFilterForDomain 默认值改为 true
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 месяц назад
fengsilin
9d4a595465
feat(region-sync): Master→Slave 配置同步、热更新与前端修复
- 新增 GET /api/internal/sync/config 接口,Master 下发 MinBalanceThreshold、MaxRetryCount、SyncBatchSize、SyncIntervalSeconds
- Slave 每 5 分钟从 Master 拉取配置并持久化到本地数据库,确保重启不丢失
- 统一 startWorker 支持动态间隔,同步间隔前端修改后无需重启立即生效
- 主节点地址从 TagInput 改为 Form.Input,修复 JSON 数组格式问题
- stringToArray 兼容 JSON 数组和换行分隔两种格式
- 清理根目录测试脚本(已迁移到 test-scripts/)
Co-Authored-By: Claude <noreply@anthropic.com>
1 месяц назад
fengsilin
1cecd5349d
feat: 跨区域配额同步(Master-Slave Region Sync)
实现 Master-Slave 架构的跨区域用户和配额同步功能,支持国内主节点与
海外从节点之间的用户创建推送、余额同步、预扣费批量回传。
主要变更:
- 新增 region_sync 服务层(SyncManager/SyncClient/推送逻辑)
- User 模型扩展 Source/RemoteUserId/SyncedQuota/LastSyncAt 字段
- BillingSession 支持 SyncedUserFunding 资金来源
- 新增 SyncAuth 中间件(X-Sync-API-Key + 常量时间比较)
- 新增 PendingSyncRecord/QuotaSyncLog 数据模型
- 前端新增区域同步配置面板
- 支持 SESSION_NAME 环境变量避免多节点 cookie 冲突
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 месяц назад
fengsilin
2ea8501938
feat(pricing): 首页定价添加分页并优化渠道 ID 展示
- 首页定价区域添加响应式分页(移动端6/平板8/桌面9)
- 渠道列表显示 ID,支持在名称中查看
- 渠道定价卡片添加 ID 标签和使用提示 Banner
- 代码示例中展示 API Key 指定渠道的格式
Co-Authored-By: Claude <noreply@anthropic.com>
1 месяц назад
fengsilin
4b17a67eea
content: 更新工具链描述文案
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 месяц назад
fengsilin
061423d21c
fix: 修复首页 Footer 无法完整下滑的问题
- 添加 home-snap-section 类让 Footer 参与 scroll snap
- 覆盖 min-height 和 height 为 auto,允许内容自适应
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 месяц назад
fengsilin
8041c22c5a
feat: 添加滚动导航组件
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 месяц назад
fengsilin
9fd8e099aa
style: 隐藏首页 CTA 区域和页脚版权信息
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 месяц назад
fengsilin
f700adabb5
style: 重构首页组件样式与布局
- HeroSection: 调整标题字体大小与布局,修复缩进一致性
- ToolsSection: 改为 icon+title 同行布局,更新工具内容
- 移除 ChannelPricingCard 编辑图标和未使用导入
- 统一部分标题添加 font-bold 样式
- 临时注释部分展示元素(版权信息、核心价值标签等)
Co-Authored-By: Claude <noreply@anthropic.com>
1 месяц назад
fengsilin
a95331a85f
chore: 隐藏侧边栏聊天子菜单、账户管理及隐私价格设置
- 注释侧边栏"聊天"子菜单,保留"操练场"
- 隐藏个人设置中的账户管理模块
- 隐藏其他设置中的价格设置和隐私设置Tab
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 месяц назад
fengsilin
62737d3f8c
feat: 添加模型详情页渠道价格展示 & 优化筛选行布局
- 新增 API 端点获取模型在各渠道的定价信息,支持全局价格回退
- 在模型详情侧边栏添加渠道价格卡片,显示所有支持该模型的渠道
- 优化 HorizontalFilterRow 组件,改用 flex-wrap 自动换行布局
- 隐藏数量为 0 的模型类型筛选项
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 месяц назад
fengsilin
96e71a3be4
fix: 支持带供应商前缀的模型名称倍率匹配
当模型名称包含供应商前缀(如 "openai/o3-mini")时,自动尝试去掉前缀重新查找倍率配置。
- 在 GetModelPrice 和 GetModelRatio 函数中添加前缀剥离逻辑
- 在前端倍率配置页面添加提示说明
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 месяц назад
fengsilin
044b5aafea
fix: 改进 RWMap JSON 加载原子性 & UI 文案调整
- types/rw_map.go: 解析失败时不再清空原有数据
- HomePricingFilters: 模型类型标签从"对话"改为"文本"
- makefile: docker-build 目标添加自动 push
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 месяц назад
fengsilin
3a32ab11dd
feat(model): 添加模型类型字段编辑功能
- 后端 Update 函数添加 type 字段支持更新
- 前端 EditModelModal 添加模型类型下拉选择器
- 新增 MODEL_TYPE_OPTIONS 共享常量(与后端 ModelType 一致)
- 添加中英文 i18n 翻译
- 修复首页"全部供应商"计数显示错误的 bug
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 месяц назад
fengsilin
5c57f692a5
feat: enhance channel pricing with price mode and color picker
- Add "by price" sub-mode for per-token pricing (auto-calculate ratios)
- Add color picker with preset colors in tag manager
- Display tags with colors in channel pricing view and selector
- Remove unused function, extract hardcoded color constants
- Fix pricing model filter (status==0 instead of status!=1)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 месяц назад
fengsilin
69713a92bd
fix: improve channel pricing UI and fix ratio naming
- Rename "输入倍率" to "模型倍率" for model_ratio field
- Rename "输出倍率" to "补全倍率" for completion_ratio field
- Update help text to reflect accurate pricing calculation
- Add search functionality for model filtering
- Improve table expansion behavior
- Fix channel data loading in ModelSettingsVisualEditor
- Conditionally show ratio/price fields based on quota type
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 месяц назад
fengsilin
b9ccbbcdbe
feat: integrate channel pricing UI into pricing settings
- Add view mode switch (global vs channel) to ModelSettingsVisualEditor
- Create ChannelPricingView component for channel-specific pricing
- Add pricing tag management tab to RatioSetting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 месяц назад
fengsilin
deda039c96
feat: add PricingTagManager component
1 месяц назад
unknown
e1f10fec95
add localiazed
2 месяцев назад
winter
08164cd0ae
fix
2 месяцев назад