From 749a1aae7eb75b361ed92785b783455cca009ca6 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Fri, 7 Aug 2026 18:46:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=85=8D=E9=9F=B3?= =?UTF-8?q?=E5=BA=93=E4=B8=8A=E4=BC=A0=E6=8C=89=E9=92=AE=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=94=99=E8=AF=AF=20(#1266)=20(#1267)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: xiaoxia Co-committed-by: xiaoxia --- apps/web/src/pages/generate/components/Step5VoiceSelect.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) {