From 64bd73db290b6d8a6434b5721bbdbafadae7179a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E9=BE=99?= Date: Sun, 31 Aug 2025 01:52:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=B7=E6=B1=82=E9=82=AE=E7=AE=B1=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=EF=BC=8C=E6=94=B9=E4=B8=BApy=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/activate/page.tsx | 3 +-- components/ChatInputBox/ChatInputBox.tsx | 31 +++++++++++++++++++++--- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/app/activate/page.tsx b/app/activate/page.tsx index 5fdc04d..c55c2eb 100644 --- a/app/activate/page.tsx +++ b/app/activate/page.tsx @@ -30,8 +30,7 @@ function ConfirmEmail({ t }: { t: string }) { setMessage('Invalid verification token'); return; } - - post(`${process.env.NEXT_PUBLIC_JAVA_URL}/api/user/activate?t=${t}`) + post(`/auth/activate?t=${t}`) .then((res) => { setStatus('success'); setMessage('Your registration has been verified. Please return to the official website to log in.'); diff --git a/components/ChatInputBox/ChatInputBox.tsx b/components/ChatInputBox/ChatInputBox.tsx index d74bd03..12cff40 100644 --- a/components/ChatInputBox/ChatInputBox.tsx +++ b/components/ChatInputBox/ChatInputBox.tsx @@ -812,6 +812,24 @@ export function ChatInputBox({ noData }: { noData: boolean }) { videoDuration: "1min", }); + // 从 localStorage 初始化配置 + useEffect(() => { + const savedConfig = localStorage.getItem('videoFlowConfig'); + if (savedConfig) { + try { + const parsed = JSON.parse(savedConfig); + setConfigOptions({ + mode: parsed.mode || "auto", + resolution: parsed.resolution || "720p", + language: parsed.language || "english", + videoDuration: parsed.videoDuration || "1min", + }); + } catch (error) { + console.warn('解析保存的配置失败,使用默认配置:', error); + } + } + }, []); + // 配置项显示控制状态 const [showConfigOptions, setShowConfigOptions] = useState(false); @@ -918,9 +936,16 @@ export function ChatInputBox({ noData }: { noData: boolean }) {
- setConfigOptions((prev) => ({ ...prev, [key]: value })) - } + onConfigChange={(key, value) => { + setConfigOptions((prev) => { + const newConfig = { ...prev, [key]: value }; + // 保存到 localStorage + if (typeof window !== 'undefined') { + localStorage.setItem('videoFlowConfig', JSON.stringify(newConfig)); + } + return newConfig; + }); + }} />
)}