diff --git a/apps/web/src/pages/generate/components/Step5VoiceSelect.tsx b/apps/web/src/pages/generate/components/Step5VoiceSelect.tsx index ca27184b7..9b56af3df 100644 --- a/apps/web/src/pages/generate/components/Step5VoiceSelect.tsx +++ b/apps/web/src/pages/generate/components/Step5VoiceSelect.tsx @@ -3,6 +3,7 @@ * 展示用户已上传的配音素材,支持选中、预览播放 */ import React, { useState, useRef, useCallback } from "react" +import { useNavigate } from "react-router-dom" import { useQuery } from "@tanstack/react-query" import { AudioOutlined, SoundOutlined } from "@ant-design/icons" import { getAssetsByKind } from "@/api/assets" @@ -34,6 +35,7 @@ const Step5VoiceSelect: React.FC = ({ selectedVoice, onSelectedVoiceChange, }) => { + const navigate = useNavigate() const [playingId, setPlayingId] = useState(null) const audioRef = useRef(null) @@ -86,8 +88,8 @@ const Step5VoiceSelect: React.FC = ({ /** 跳转到配音库上传 */ const handleGoToUpload = useCallback(() => { - window.location.href = "/voices" - }, []) + navigate("/app/voices") + }, [navigate]) // 加载中状态 if (isLoading) {