fix(openai): 修复关闭 codex_cli_only 无法持久化问题
在编辑 OpenAI OAuth 账号时,若 codex_cli_only 从开启切换为关闭, 现改为显式写入 false,避免 extra 为空时后端忽略更新导致旧值残留。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1 +1 @@
|
|||||||
0.1.74.5
|
0.1.74.6
|
||||||
|
|||||||
@@ -1823,6 +1823,7 @@ const handleSubmit = async () => {
|
|||||||
if (props.account.platform === 'openai' && (props.account.type === 'oauth' || props.account.type === 'apikey')) {
|
if (props.account.platform === 'openai' && (props.account.type === 'oauth' || props.account.type === 'apikey')) {
|
||||||
const currentExtra = (props.account.extra as Record<string, unknown>) || {}
|
const currentExtra = (props.account.extra as Record<string, unknown>) || {}
|
||||||
const newExtra: Record<string, unknown> = { ...currentExtra }
|
const newExtra: Record<string, unknown> = { ...currentExtra }
|
||||||
|
const hadCodexCLIOnlyEnabled = currentExtra.codex_cli_only === true
|
||||||
if (openaiPassthroughEnabled.value) {
|
if (openaiPassthroughEnabled.value) {
|
||||||
newExtra.openai_passthrough = true
|
newExtra.openai_passthrough = true
|
||||||
} else {
|
} else {
|
||||||
@@ -1830,10 +1831,15 @@ const handleSubmit = async () => {
|
|||||||
delete newExtra.openai_oauth_passthrough
|
delete newExtra.openai_oauth_passthrough
|
||||||
}
|
}
|
||||||
|
|
||||||
if (props.account.type === 'oauth' && codexCLIOnlyEnabled.value) {
|
if (props.account.type === 'oauth') {
|
||||||
newExtra.codex_cli_only = true
|
if (codexCLIOnlyEnabled.value) {
|
||||||
} else {
|
newExtra.codex_cli_only = true
|
||||||
delete newExtra.codex_cli_only
|
} else if (hadCodexCLIOnlyEnabled) {
|
||||||
|
// 关闭时显式写 false,避免 extra 为空被后端忽略导致旧值无法清除
|
||||||
|
newExtra.codex_cli_only = false
|
||||||
|
} else {
|
||||||
|
delete newExtra.codex_cli_only
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updatePayload.extra = newExtra
|
updatePayload.extra = newExtra
|
||||||
|
|||||||
Reference in New Issue
Block a user