fix: upload remote image preview (#9952)

This commit is contained in:
zxhlyh 2024-11-01 15:45:27 +08:00 • committed by GitHub
commit 78b74cce8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 50 additions and 33 deletions

View file

@ -43,10 +43,13 @@ export const fileUpload: FileUpload = ({
})
}
export const getFileExtension = (fileName: string, fileMimetype: string) => {
export const getFileExtension = (fileName: string, fileMimetype: string, isRemote?: boolean) => {
if (fileMimetype)
return mime.getExtension(fileMimetype) || ''
if (isRemote)
return ''
if (fileName) {
const fileNamePair = fileName.split('.')
const fileNamePairLength = fileNamePair.length