fix: file name incorrect when download file (#19183)

This commit is contained in:
非法操作
2025-04-30 22:47:59 +08:00
committed by GitHub
parent 349c3cf7b8
commit 1ca6dbcdc8
3 changed files with 6 additions and 4 deletions

View File

@@ -32,6 +32,7 @@ const FileImageItem = ({
}: FileImageItemProps) => {
const { id, progress, base64Url, url, name } = file
const [imagePreviewUrl, setImagePreviewUrl] = useState('')
const download_url = url ? `${url}&as_attachment=true` : base64Url
return (
<>
@@ -84,7 +85,7 @@ const FileImageItem = ({
className='absolute bottom-0.5 right-0.5 flex h-6 w-6 items-center justify-center rounded-lg bg-components-actionbar-bg shadow-md'
onClick={(e) => {
e.stopPropagation()
downloadFile(url || base64Url || '', name)
downloadFile(download_url || '', name)
}}
>
<RiDownloadLine className='h-4 w-4 text-text-tertiary' />