diff --git a/apps/web/src/api/assets.ts b/apps/web/src/api/assets.ts index 8d1f04450..8cb2aa49b 100755 --- a/apps/web/src/api/assets.ts +++ b/apps/web/src/api/assets.ts @@ -184,13 +184,19 @@ export const getAssetsByKind = async ( gender?: string style?: string tag_ids?: string[] + limit?: number + page?: number + page_size?: number }, ): Promise => { - const params: Record = { kind } + const params: Record = { kind } if (filters?.keyword) params.keyword = filters.keyword if (filters?.gender) params.gender = filters.gender if (filters?.style) params.style = filters.style if (filters?.tag_ids?.length) params.tag_ids = filters.tag_ids.join(",") + if (filters?.limit) params.limit = filters.limit + if (filters?.page) params.page = filters.page + if (filters?.page_size) params.page_size = filters.page_size const response = await apiClient.get("/assets", { params }) return response.data.items || [] } diff --git a/apps/web/src/pages/voices/VoiceLibrary.tsx b/apps/web/src/pages/voices/VoiceLibrary.tsx index 034fea8a6..7e3ae0242 100755 --- a/apps/web/src/pages/voices/VoiceLibrary.tsx +++ b/apps/web/src/pages/voices/VoiceLibrary.tsx @@ -826,7 +826,7 @@ const VoiceLibrary: React.FC = () => { ) const presetCount = unifiedStats?.preset_count ?? presetData?.total ?? 0 const cloneCount = unifiedStats?.clone_count ?? cloneData?.total ?? 0 - const materialCount = materialData?.total ?? (materialData?.items?.length || 0) + const materialCount = materialData?.length ?? 0 const filteredPreset = useMemo(() => { let list = presetVoices @@ -1175,9 +1175,9 @@ const VoiceLibrary: React.FC = () => { )} {/* 卡片列表 */} - {!materialLoading && (materialData?.items?.length || 0) > 0 && ( + {!materialLoading && (materialData?.length || 0) > 0 && (
- {(materialData?.items || []).map((asset: AssetItem) => { + {(materialData || []).map((asset: AssetItem) => { const duration = (asset.metadata?.duration as number) || 0 const minutes = Math.floor(duration / 60) const seconds = Math.floor(duration % 60) @@ -1208,7 +1208,7 @@ const VoiceLibrary: React.FC = () => { )} {/* 空状态 */} - {!materialLoading && (materialData?.items?.length || 0) === 0 && ( + {!materialLoading && (materialData?.length || 0) === 0 && (