fix(grok): 修正授权与模型映射边界

This commit is contained in:
IanShaw027
2026-08-07 14:50:02 +08:00
parent 2c8836e40b
commit 0316994c52
6 changed files with 29 additions and 11 deletions
@@ -5488,8 +5488,9 @@ const handleGrokAuthorizePassword = async (emailPasswordInput: string) => {
const lines = emailPasswordInput
.split('\n')
.map((line) => line.trim())
.filter((line) => line && line.includes('----'))
// Keep the password portion byte-for-byte; trim is only for determining
// whether this textarea line is blank.
.filter((line) => line.trim() && line.includes('----'))
if (lines.length === 0) {
grokOAuth.error.value = t(
@@ -678,8 +678,8 @@ const handleGrokAuthorizePassword = async (emailPasswordInput: string) => {
if (!props.account || !isGrok.value) return
const line = emailPasswordInput
.split('\n')
.map((item) => item.trim())
.find((item) => item.includes('----'))
// Email is normalized in the API helper, but password whitespace is valid.
.find((item) => item.trim() && item.includes('----'))
if (!line) {
grokOAuth.error.value = t(
'admin.accounts.oauth.grok.pleaseEnterPassword',