fix: upload remote image preview (#9952)

This commit is contained in:
zxhlyh
2024-11-01 15:45:27 +08:00
committed by GitHub
parent 82033af097
commit 78b74cce8e
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