diff --git a/apps/web/src/pages/generate/GeneratePage.tsx b/apps/web/src/pages/generate/GeneratePage.tsx index a3adf2bbe..ec513f211 100644 --- a/apps/web/src/pages/generate/GeneratePage.tsx +++ b/apps/web/src/pages/generate/GeneratePage.tsx @@ -84,12 +84,16 @@ const GeneratePage: React.FC = () => { const [previewCount, setPreviewCount] = useState(1) /* ── 根据 voiceMode 构建 voiceIds 传给预览接口 ── */ - const previewVoiceIds = useMemo(() => { + /* selectedVoice / selectedClonedVoice 均为 string 类型(voice ID), + 见 useGenerateFormState 返回值类型定义 */ + const previewVoiceIds = useMemo((): string[] => { if (voiceMode === "clone") { - return selectedClonedVoice ? [String(selectedClonedVoice)] : [] + const id: string = selectedClonedVoice + return id ? [id] : [] } // preset / custom 模式 - return selectedVoice ? [String(selectedVoice)] : [] + const id: string = selectedVoice + return id ? [id] : [] }, [voiceMode, selectedVoice, selectedClonedVoice]) /* ── Step4 预览生成(多预览 + voice_ids) ── */