fix: 修复配音库上传按钮跳转路径错误 (#1266) #1267

Merged
auto-approve-bot merged 1 commits from fix/issue-1266-voice-upload-redirect into develop 2026-08-07 18:46:04 +08:00
@@ -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<Step5VoiceSelectProps> = ({
selectedVoice,
onSelectedVoiceChange,
}) => {
const navigate = useNavigate()
const [playingId, setPlayingId] = useState<string | null>(null)
const audioRef = useRef<HTMLAudioElement | null>(null)
@@ -86,8 +88,8 @@ const Step5VoiceSelect: React.FC<Step5VoiceSelectProps> = ({
/** 跳转到配音库上传 */
const handleGoToUpload = useCallback(() => {
window.location.href = "/voices"
}, [])
navigate("/app/voices")
}, [navigate])
// 加载中状态
if (isLoading) {