feat: 任务3.11 配音库页面升级 — 对接后端真实API
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 169h9m48s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 169h9m52s
Deploy / Deploy Staging (push) Failing after 169h11m45s
CI/CD Pipeline / Frontend Lint (push) Failing after 169h12m18s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 169h12m24s
Deploy / Production Browser E2E (push) Failing after 1827h44m53s
Deploy / Deploy Production (push) Failing after 1827h45m28s
Deploy / Build Production Runtime Images (push) Failing after 1827h46m3s

- 重写 voices.ts:新增统一音色 API(fetchVoices/fetchPresetVoices),保留旧接口向后兼容
- 重写 voiceClone.ts:对接后端音色克隆 API,导出 toVoiceClone 类型转换
- 升级 VoiceLibrary.tsx:删除所有 Mock 数据,useQuery 对接 preset/clone/unified 三个接口
- 修复 CloneVoiceModal/VoiceCloneModal:toVoiceClone 包装 createVoiceClone 返回值
- 修复 VoiceClone.tsx:useQuery queryFn 箭头函数包装
This commit is contained in:
灵应
2026-07-02 11:40:33 +08:00
parent 23e3b9cc8e
commit b0aee55ff5
6 changed files with 335 additions and 203 deletions
@@ -8,7 +8,7 @@
*/
import React, { useState, useCallback, useRef } from "react";
import { Modal, Button } from "@/components/ui";
import { createVoiceClone } from "@/api/voiceClone";
import { createVoiceClone, toVoiceClone } from "@/api/voiceClone";
import type { VoiceClone } from "@/api/voiceClone";
import "./clone-voice-modal.css";
@@ -133,7 +133,7 @@ const CloneVoiceModal: React.FC<CloneVoiceModalProps> = ({
// 2秒后自动关闭
setTimeout(() => {
onSuccess?.(result);
onSuccess?.(toVoiceClone(result));
handleClose();
}, 2000);
} catch {
@@ -10,7 +10,7 @@
*/
import React, { useState, useCallback, useRef, useEffect } from "react";
import { Modal, Button } from "@/components/ui";
import { createVoiceClone } from "@/api/voiceClone";
import { createVoiceClone, toVoiceClone } from "@/api/voiceClone";
import type { VoiceClone } from "@/api/voiceClone";
import "./voice-clone-modal.css";
@@ -198,7 +198,7 @@ const VoiceCloneModal: React.FC<VoiceCloneModalProps> = ({
// 2秒后自动关闭
setTimeout(() => {
onSuccess?.(result);
onSuccess?.(toVoiceClone(result));
handleClose();
}, 2000);
} catch {