From 3827d09ad3ba08a2c8d6aeea1f7e36372116c637 Mon Sep 17 00:00:00 2001 From: admin <572701190@qq.com> Date: Mon, 20 Apr 2026 02:28:08 +0800 Subject: [PATCH] =?UTF-8?q?security:=20=E8=AE=AF=E9=A3=9E=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E8=BE=93=E5=85=A5=E6=A1=86=E6=94=B9=E7=94=A8ref?= =?UTF-8?q?=E9=9D=9E=E5=8F=97=E6=8E=A7=E8=AE=BE=E7=BD=AE=EF=BC=8C=E9=98=B2?= =?UTF-8?q?=E6=AD=A2DOM=20value=E5=B1=9E=E6=80=A7=E6=9A=B4=E9=9C=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/SystemSettings.tsx | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/pages/SystemSettings.tsx b/src/pages/SystemSettings.tsx index 8234e12..9fd9190 100644 --- a/src/pages/SystemSettings.tsx +++ b/src/pages/SystemSettings.tsx @@ -23,6 +23,9 @@ export default function SystemSettings() { const [modeModalOpen, setModeModalOpen] = useState(false); const [availableModels, setAvailableModels] = useState([]); const apiKeyInputRef = useRef(null); + const xfAppIdRef = useRef(null); + const xfApiKeyRef = useRef(null); + const xfApiSecretRef = useRef(null); useEffect(() => { if (apiKeyInputRef.current) { @@ -33,6 +36,21 @@ export default function SystemSettings() { } }, [settings.aiProviders[settings.activeAiProvider]?.apiKey]); + useEffect(() => { + if (xfAppIdRef.current) { + const target = settings.xfSpeechConfig?.appId || ''; + if (xfAppIdRef.current.value !== target) xfAppIdRef.current.value = target; + } + if (xfApiKeyRef.current) { + const target = settings.xfSpeechConfig?.apiKey || ''; + if (xfApiKeyRef.current.value !== target) xfApiKeyRef.current.value = target; + } + if (xfApiSecretRef.current) { + const target = settings.xfSpeechConfig?.apiSecret || ''; + if (xfApiSecretRef.current.value !== target) xfApiSecretRef.current.value = target; + } + }, [settings.xfSpeechConfig]); + useEffect(() => { const user = storage.get('currentUser', null); if (!user) { @@ -436,8 +454,8 @@ export default function SystemSettings() {
{ const next = { ...(settings.xfSpeechConfig || { appId: '', apiKey: '', apiSecret: '' }), appId: e.target.value }; setSettings({ ...settings, xfSpeechConfig: next }); @@ -452,8 +470,8 @@ export default function SystemSettings() {
{ const next = { ...(settings.xfSpeechConfig || { appId: '', apiKey: '', apiSecret: '' }), apiKey: e.target.value }; setSettings({ ...settings, xfSpeechConfig: next }); @@ -468,8 +486,8 @@ export default function SystemSettings() {
{ const next = { ...(settings.xfSpeechConfig || { appId: '', apiKey: '', apiSecret: '' }), apiSecret: e.target.value }; setSettings({ ...settings, xfSpeechConfig: next });