feat(account): 账号编辑弹窗支持手动覆盖 OpenAI 订阅档位 plan_type(仅 OAuth)#4055
Open
iMouseWu wants to merge 1 commit into
Open
feat(account): 账号编辑弹窗支持手动覆盖 OpenAI 订阅档位 plan_type(仅 OAuth)#4055iMouseWu wants to merge 1 commit into
iMouseWu wants to merge 1 commit into
Conversation
此前 plan_type(ChatGPT Plus/Pro/Free)只由系统自动写入(OAuth 换码/刷新、 429 同步、导入),UI 无编辑入口。现于 EditAccountModal 为 OpenAI OAuth 非影子 账号新增一个订阅档位下拉,可手动纠正(走既有 PUT /admin/accounts/:id 合并, plan_type 非敏感字段无需改后端)。 - 仅 OAuth 非影子账号显示/提交:setup-token 无订阅调度语义 (IsOpenAIChatGPTSubscription 要求 oauth),影子账号凭据由母账号管理 - 下拉:清空 + Plus/Pro/Free;别名(chatgptpro→Pro)与自定义值(team 等) 友好显示并保留 canonical 值,避免编辑丢失或写脏 - readPlanType 仅接受字符串,挡住脏数据;清空则删除该键(恢复自动识别) - 抽 buildPlanTypeOptions/applyPlanType/readPlanType/planTypeDisplayLabel 为 纯函数入 credentialsBuilder.ts,并补 12 个单测(别名去重、保留其余凭据键、 set/delete 语义) - 文案(zh/en)注明:令牌临期刷新或 429 会用真实档位自动覆盖手改值 经三方评审会(Claude + Codex + 作者)一轮交叉评审达成共识后落地。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
|
recheck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题场景
账号管理列表里 OpenAI 账号的 Plus / Pro / Free 徽章读的是 credentials.plan_type,而这个字段只由系统自动写入,没有任何手动编辑入口:
问题在于这些自动来源有时滞后或不准:
此时管理员想纠正一下,只能直接调 PUT /admin/accounts/:id 或重新导入,没有 UI 入口——不方便,也容易误操作把其它凭据字段带没了。
解决思路
在账号编辑弹窗(EditAccountModal)给 OpenAI 账号加一个"订阅档位(手动覆盖)"下拉,让管理员直接改 plan_type。