真人/虚拟人像库BUG修复V2 | admin build

This commit is contained in:
2026-07-07 14:13:04 +08:00
parent 01b520ac49
commit 48b41f7ab9
4 changed files with 71 additions and 62 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -28,7 +28,7 @@
}
})();
</script>
<script type="module" crossorigin src="/assets/index-Bo_aUzmj.js"></script>
<script type="module" crossorigin src="/assets/index-W_zV5GBi.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-D7ShJUt4.css">
</head>
<body>
@@ -5,6 +5,7 @@ import { CopyOutlined, PlayCircleOutlined, ReloadOutlined, SearchOutlined } from
import { adminGetPrivatePortraitAssets, adminGetPrivatePortraitProjects } from '../api';
import type { PrivatePortraitAsset, PrivatePortraitProject } from '../types';
import { formatDate } from '../utils/formatDate';
import { apiUrl } from '../utils/resourceUrl';
const { Title, Text } = Typography;
@@ -81,9 +82,16 @@ const copyText = async (value?: string | null) => {
message.success('已复制');
};
const toPreviewUrl = (value?: string | null) => {
if (!value) return '';
const trimmed = String(value).trim();
if (!trimmed || trimmed.startsWith('asset://')) return '';
return apiUrl(trimmed);
};
const PreviewCell: React.FC<{ asset: PrivatePortraitAsset }> = ({ asset }) => {
const url = asset.displayUrl || asset.previewUrl || asset.remoteUrl || asset.sourceUrl;
const cover = asset.videoCoverUrl || asset.previewUrl || asset.displayUrl;
const url = toPreviewUrl(asset.displayUrl || asset.previewUrl || asset.remoteUrl || asset.sourceUrl);
const cover = toPreviewUrl(asset.videoCoverUrl || asset.previewUrl || asset.displayUrl || asset.sourceUrl);
if (asset.assetType === 'Video') {
return (
<div style={{ width: 72, height: 52, borderRadius: 10, overflow: 'hidden', background: '#f5f3ff', display: 'flex', alignItems: 'center', justifyContent: 'center', position: 'relative' }}>
+2 -1
View File
@@ -68,4 +68,5 @@ api_router.include_router(team_router)
api_router.include_router(home_materials_router)
api_router.include_router(admin_module_router)
api_router.include_router(material_admin_router)
api_router.include_router(private_portrait_router)
api_router.include_router(private_portrait_router)
api_router.include_router(private_portrait_virtual_router)