소스 검색

fix:custom file extension not support (#10759)

Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
呆萌闷油瓶 7 달 전
부모
커밋
c170862de7
1개의 변경된 파일6개의 추가작업 그리고 6개의 파일을 삭제
  1. 6 6
      web/app/components/base/file-uploader/utils.ts

+ 6 - 6
web/app/components/base/file-uploader/utils.ts

@@ -44,12 +44,6 @@ export const fileUpload: FileUpload = ({
 }
 
 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
@@ -58,6 +52,12 @@ export const getFileExtension = (fileName: string, fileMimetype: string, isRemot
       return fileNamePair[fileNamePairLength - 1]
   }
 
+  if (fileMimetype)
+    return mime.getExtension(fileMimetype) || ''
+
+  if (isRemote)
+    return ''
+
   return ''
 }