This commit is contained in:
2026-07-16 09:39:19 +08:00
parent 01c55721ca
commit e44885461b
3 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -364,12 +364,13 @@ const AdminSettings: React.FC = () => {
</Typography.Text>
);
}
const fullUrl = url.startsWith('http') ? url : `${import.meta.env.VITE_API_BASE || 'http://localhost:8000'}${url}`;
const isGif = url.toLowerCase().endsWith('.gif');
return isGif ? (
<img src={url} alt="预览" style={{ width: '100%', maxHeight: 200, borderRadius: 8, background: '#f0f0f5', objectFit: 'contain' }} />
<img src={fullUrl} alt="预览" style={{ width: '100%', maxHeight: 200, borderRadius: 8, background: '#f0f0f5', objectFit: 'contain' }} />
) : (
<video
src={url}
src={fullUrl}
controls
muted
autoPlay