DaydreamCoding
b19da9c7fe
feat(dingtalk): 钉钉 OAuth 登录接入与 internal_only 用户属性同步
...
⚠️ 应用类型约束:当前实现仅支持「钉钉登录-企业内部应用」(DingTalk 开放平台
internal_app 类型)。第三方个人应用、第三方企业应用类型暂不支持——OAuth 流程
相同但 corp 校验、跨企业行为不同。backend 通过 DingTalkAppKind 校验对非
internal_app 类型 fail-closed(硬约束)。
钉钉 OAuth 登录主链
- 4 步 OAuth 链:ExchangeCodeForUserToken / GetUnionIdByUserToken /
GetUserIdByUnionId / GetStaffInfoByUserId;app token 缓存
- pending session 机制持久化 OAuth 中间态;cookie-only token 持久化
- 三种分流:bind_login_required / email_completion / choose_account_action
- corp_restriction_policy 支持 none + internal_only;stale "whitelist" 在
加载层与写入层均静默 coerce 为 none + slog.Warn
- bypass_registration 开关:企业内部模式豁免全局 REGISTRATION_DISABLED
- isReservedEmail / signup_source / canUnbindProvider / OAuth pending flow
等横切点支持 dingtalk provider
- migration 136:4 表 CHECK 约束加入 'dingtalk' provider 值
internal_only 模式同步企业邮箱/姓名/部门到用户属性
- SyncCorpEmail / SyncDisplayName / SyncDept 三个独立开关 + 对应
SyncXxxAttrKey 目标属性 key(默认 dingtalk_email / dingtalk_name /
dingtalk_department);非 internal_only policy 在写入层与加载层均
coerce 为 false,admin handler 与 setting_service 双层兜底
- 同步语义:首次注册写 users.username(昵称优先 → 企业姓名 fallback),
之后每次登录刷新 3 个属性;空值也写入以覆盖旧值
- 邮箱三级 fallback:org_email > email > extension["企业邮箱"]
(钉钉自定义字段 JSON)
- 部门路径递归向上拼接,跳过 dept_id=1 选首个真实子部门,剥离根组织名
- GetUnionIdByUserToken 同时返回 OIDC /contact/users/me 的 nick 字段;
新增 GetDeptInfo 调用 OAPI /topapi/v2/department/get
- AuthHandler 注入 UserAttributeService;OAuth pending flow 在
createPendingOAuthAccount / bindPendingOAuthLogin 分别派发到
AfterRegistration(syncUsername=true)/ AfterLogin
- migration 137 seed dingtalk_email/name/department 三个用户属性定义
附带修复(同集成路径暴露的两个 OAuth 注册回归)
- LoginOrRegisterOAuthWithTokenPair 新建用户分支用 inferLegacySignupSource
覆写 caller 显式传入的 signupSource,导致 dingtalk/linuxdo/oidc/wechat
渠道授权按 email 渠道读取;改为只在 caller 未显式传入时回退邮箱推断
- mergeProviderDefaultGrantSettings 把 parse fallback 默认值
(Concurrency=5 / Balance=0) 当作"未配置"哨兵,admin 显式设 5 时被误判
退回全局默认(复现:全局默认 1 + 渠道默认并发 5 + grant_on_signup → 新
用户实际 concurrency=1);去掉哨兵,admin 任何 >=0 值都覆盖 globalDefaults
前端
- DingTalk Login / Callback / EmailCompletion / ChoiceAccount / Error
视图;router + auth API client
- admin SettingsView:corp policy radio(none / internal_only)+ bypass
注册开关 + i18n;internal_only 下展示三同步开关 + 目标 attr key 下拉
(拉取 user attribute definitions),展示 fieldEmail /
qyapi_get_department_list 钉钉权限申请提示
- Profile:S1 主动绑定 / S5 解绑钉钉按钮 + 合成邮箱防自锁
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 15:27:47 +08:00
Wesley Liddick
6a88e560c2
Merge pull request #2393 from hoobnn/fix/totp-autofill
...
fix: add autocomplete for TOTP autofill support
2026-05-19 15:16:28 +08:00
Wesley Liddick
e9a09d8721
Merge pull request #2395 from imlewc/fix-oidc-compat-email-display
...
fix(auth): prefer OIDC compat email in pending flow
2026-05-19 15:13:55 +08:00
Wesley Liddick
548c71c8bb
Merge pull request #2557 from Arron196/fix/issue-2542-daily-card-expiry-mode
...
fix: 修复日卡跨日重复刷新额度
2026-05-19 14:53:22 +08:00
Wesley Liddick
f05670dd0f
Merge pull request #2454 from wucm667/codex/issue-2426-model-mapping
...
fix(account): 保留模型白名单和模型映射组合配置
2026-05-19 14:50:03 +08:00
Wesley Liddick
e365aae450
Merge pull request #2450 from wucm667/codex/issue-2431-responses-api-support
...
feat: 支持后台配置 OpenAI Responses API 路由
2026-05-19 14:47:10 +08:00
Wesley Liddick
9f1a2c234d
Merge pull request #2448 from wucm667/codex/issue-2334-copy-all
...
fix: 修复兑换码生成后复制全部报错
2026-05-19 14:45:38 +08:00
Wesley Liddick
03473d3ee8
Merge pull request #2554 from Arron196/feature/sync-upstream-models-pr
...
feat: 支持从上游同步账号可用模型列表
2026-05-19 14:42:47 +08:00
Wesley Liddick
c65522641d
Merge pull request #2473 from is7Qin/fix/image-tier-validation
...
fix(channels): 按次/图片计费模式下区间校验跳过 token 上下文重叠规则
2026-05-19 14:28:33 +08:00
Wesley Liddick
082216befc
Merge pull request #2508 from honue/main
...
fix: 修复管理后台分组页可用账号数显示错误
2026-05-19 14:08:00 +08:00
Wesley Liddick
a340002c6d
Merge pull request #2401 from 2ue/fix/normalize-image-billing-size
...
修复图片计费尺寸归一化与使用记录展示
2026-05-19 14:00:24 +08:00
name
ddab7de916
Merge branch 'main' into fix/image-tier-validation
2026-05-19 11:06:17 +08:00
Wesley Liddick
8584b8f7cf
Merge pull request #2504 from yetone/fix-admin-settings-darkmode
...
fix(admin/settings): make tab shell readable in dark mode
2026-05-19 09:55:01 +08:00
Wesley Liddick
e318376e88
Merge pull request #2548 from Arron196/fix/sla-exclude-capacity-errors
...
fix: 统一 Ops SLA 与请求错误统计口径
2026-05-19 09:29:22 +08:00
benjamin
f1cc83e0ee
fix(admin): 修正管理端日卡额度提示
...
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent )
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 21:09:11 +08:00
benjamin
a66f771cb1
fix(frontend): 修正用户端日卡额度提示
...
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent )
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 21:09:11 +08:00
benjamin
0b40470597
i18n: 增加日卡额度结束文案
...
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent )
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 21:09:11 +08:00
benjamin
af6cdfabcc
feat(frontend): 增加订阅配额时间判断工具
...
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent )
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 21:09:11 +08:00
benjamin
5713820813
feat: add upstream model sync controls
...
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent )
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 19:01:55 +08:00
benjamin
3b4eccdd5d
feat: add upstream model sync frontend API
...
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent )
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 19:01:44 +08:00
benjamin
5dae745e86
test: 避免 Ops 图表测试使用保留组件名
...
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent )
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 17:12:41 +08:00
benjamin
924e10831a
fix: 更新 Ops 错误分布口径文案
...
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent )
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 16:53:16 +08:00
benjamin
09cec311e8
fix: 统一 Ops 请求错误图表 SLA 口径
...
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent )
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
2026-05-18 16:52:44 +08:00
Yuhao Jiang
1b03240515
fix(payment): 修复支付宝官方扫码二维码生成错误
...
支付宝官方服务商在 precreate(当面付)不可用回退到 page.pay 时,
错误地把网页跳转 URL 当作可扫码二维码内容返回。前端用 QRCode 库
把这段 URL 渲染成二维码后,支付宝 APP 无法识别(扫到的只是个 HTTP
URL,不是支付二维码),用户必须点"重新打开支付页面"跳转到支付宝
收银台才能扫到真正可用的二维码。
- 后端 alipay.go:createPagePayTrade 不再把 PayURL 塞给 QRCode;
createDesktopTrade 在 paymentMode == "redirect" 时跳过 precreate
直接走 page.pay,避免没开通"当面付"的商户走一次无用的 API 调用
- 前端管理端 PaymentProviderDialog:让支付宝官方实例可在"支付模式"
中选择"跳转",开启后始终在新标签页打开支付宝收银台
- ProviderCard 的 modeLabel 增加 redirect 分支
- 补充 TestCreateTradeRedirectModeSkipsPrecreate 单元测试
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 15:01:17 -05:00
honue
360f8dec1a
fix: 修复管理后台分组页可用账号数显示错误
2026-05-16 11:16:56 +08:00
yetone
b0c7723393
fix(admin/settings): make tab shell readable in dark mode
...
Vue's scoped-CSS compiler was dropping the `:global(.dark) .settings-tabs-shell`
rules in the production build, so the tab strip kept its light-mode white
background and the inactive tab labels (text-gray-300) showed at ~1.6:1
contrast — effectively unreadable.
Hoist the three dark-mode overrides into an unscoped `<style>` block so they
survive the scoped-CSS transform.
2026-05-16 01:00:03 +08:00
name
b936925c8a
fix(channels): 按次/图片计费模式跳过 token 区间重叠校验
...
image 与 per_request 模式的层级按 tier_label (1K/2K/4K) 匹配,
不依赖 min/max token 范围, 多个层级共用 min=0/max=null 是预期形态。
原校验器一律按 token 上下文分段处理, 新增第二条图片层级时会被
"无上限区间只能是最后一个" 误拦, 导致 OpenAI gpt-image 等模型
无法保存按次定价。
validateIntervals 新增 mode 参数, image / per_request 模式跳过
区间重叠与 last-unlimited 检查, 保留单条 min/max 自洽与价格非负
校验。token 模式行为不变。
2026-05-14 23:48:47 +08:00
wucm667
827764d7bd
fix(account): preserve combined model restrictions
2026-05-14 15:00:28 +08:00
wucm667
862819042c
feat(openai): 支持后台配置 Responses API 路由
2026-05-14 11:46:24 +08:00
wucm667
4d51e53d20
fix(redeem): 修复批量复制兑换码兼容性
2026-05-14 11:35:00 +08:00
2ue
bb4c1abe28
Fix image billing size normalization
2026-05-12 15:21:31 +08:00
imlewc
224e9fc6c2
fix(auth): prefer OIDC compat email in pending flow
2026-05-12 14:35:20 +08:00
hoobnn
4467922199
fix: add autocomplete="one-time-code" for TOTP autofill support
...
Add a hidden input with autocomplete="one-time-code" so password managers
(1Password, Bitwarden, Chrome, Apple Keychain) can detect and auto-fill
TOTP verification codes during 2FA login.
2026-05-12 13:54:41 +08:00
shaw
a07a0dac63
feat: add configurable Antigravity user agent version
2026-05-11 22:25:20 +08:00
shaw
9377c96746
fix: 让消息 cache_control 改写默认关闭
2026-05-11 21:26:41 +08:00
Wesley Liddick
1e2f55078c
Merge pull request #2289 from wucm667/fix/ccswitch-import-model
...
fix(ccswitch): 修复 Codex 导入缺少模型参数
2026-05-11 16:12:47 +08:00
shaw
18cc4691e6
优化系统设置页标签导航
2026-05-11 16:10:40 +08:00
Wesley Liddick
8b0b507a95
Merge pull request #2314 from dexcoder6/fix/payment-result-nan
...
Fix/payment result nan
2026-05-11 11:24:46 +08:00
shaw
b23055af5b
feat: add Airwallex payments and multi-currency support
2026-05-11 11:17:26 +08:00
dexcoder6
ba1c6fa5fd
fix: 修复管理端订单详情充值金额显示 NaN
...
与支付成功页同源问题:fee_rate=0 时后端 omitempty 剔除字段,前端
`fee_rate <= 0` 判断对 undefined 失效,进入除法分支得到 NaN。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 13:47:57 +08:00
dexcoder6
6884b03e59
fix: 修复支付成功页充值金额显示 NaN
...
后端 ent 模型 PaymentOrder.FeeRate 带 omitempty,fee_rate=0 的订单
在 JSON 序列化时该字段会被剔除。前端 baseAmount 计算用 `fee_rate <= 0`
判断走分支,但 `undefined <= 0` 为 false,因此进入除法分支得到 NaN。
将 fee_rate 通过 Number(...) || 0 归一化,使缺失字段等价于 0。
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 13:45:49 +08:00
wucm667
65493df95a
fix(ccswitch): add codex model to import deeplink
2026-05-08 17:31:36 +08:00
shaw
fda1ed459d
feat: 优化 OAuth 账号导入流程
2026-05-08 11:36:09 +08:00
shaw
e872cbec0b
feat: 添加登录注册条款确认
2026-05-07 17:35:05 +08:00
shaw
6681aee98d
更新账号模型白名单
2026-05-07 15:11:38 +08:00
shaw
0eca600ffa
fix moderation key handling and key UI
2026-05-07 14:31:19 +08:00
shaw
7a9c1d7edd
feat(frontend): add account Codex image bridge control
2026-05-07 11:07:33 +08:00
Wesley Liddick
45b1e6ae41
Merge pull request #2233 from Arron196/fix/codex-image-generation-bridge-switch
...
fix(openai): 增加 Codex 图片生成桥接显式开关
2026-05-07 10:30:26 +08:00
Wesley Liddick
e69319e747
Merge pull request #2224 from lyen1688/feat-email-oauth-github-google
...
feat: 增加 GitHub 和 Google 邮箱快捷登录
2026-05-07 10:07:28 +08:00
shaw
989f87fe08
fix: harden markdown page image paths
2026-05-07 10:05:49 +08:00