1
This commit is contained in:
@@ -345,7 +345,7 @@ const AdminSettings: React.FC = () => {
|
||||
</Button>
|
||||
)}
|
||||
<Upload
|
||||
accept="video/mp4,video/webm,video/mov"
|
||||
accept="video/*,image/gif,image/webp"
|
||||
showUploadList={false}
|
||||
beforeUpload={handleLoginVideoUpload}
|
||||
>
|
||||
@@ -355,20 +355,32 @@ const AdminSettings: React.FC = () => {
|
||||
</Upload>
|
||||
</Space>
|
||||
</div>
|
||||
{form.getFieldValue('login_bg_video') ? (
|
||||
<video
|
||||
src={form.getFieldValue('login_bg_video')}
|
||||
controls
|
||||
muted
|
||||
style={{ width: '100%', maxHeight: 200, borderRadius: 8, background: '#000' }}
|
||||
/>
|
||||
) : (
|
||||
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
||||
未设置,前台将默认使用 backimage.png
|
||||
</Typography.Text>
|
||||
)}
|
||||
{(() => {
|
||||
const url = form.getFieldValue('login_bg_video');
|
||||
if (!url) {
|
||||
return (
|
||||
<Typography.Text type="secondary" style={{ fontSize: 12 }}>
|
||||
未设置,前台将默认使用 backimage.png
|
||||
</Typography.Text>
|
||||
);
|
||||
}
|
||||
const isGif = url.toLowerCase().endsWith('.gif');
|
||||
return isGif ? (
|
||||
<img src={url} alt="预览" style={{ width: '100%', maxHeight: 200, borderRadius: 8, background: '#f0f0f5', objectFit: 'contain' }} />
|
||||
) : (
|
||||
<video
|
||||
src={url}
|
||||
controls
|
||||
muted
|
||||
autoPlay
|
||||
loop
|
||||
playsInline
|
||||
style={{ width: '100%', maxHeight: 200, borderRadius: 8, background: '#000' }}
|
||||
/>
|
||||
);
|
||||
})()}
|
||||
<Typography.Text type="secondary" style={{ fontSize: 12, display: 'block', marginTop: 6 }}>
|
||||
支持 MP4、WebM、MOV,最大 50MB
|
||||
支持 MP4、WebM、MOV、GIF、WebP,最大 50MB
|
||||
</Typography.Text>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user