fix: upload custom file extension (#10801)

This commit is contained in:
zxhlyh 2024-11-18 15:57:32 +08:00 • committed by GitHub
commit 9861279395
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 11 additions and 12 deletions

View file

@ -21,7 +21,7 @@ const FileInput = ({
const allowedFileTypes = fileConfig.allowed_file_types
const isCustom = allowedFileTypes?.includes(SupportUploadFileTypes.custom)
const exts = isCustom ? (fileConfig.allowed_file_extensions?.map(item => `.${item}`) || []) : (allowedFileTypes?.map(type => FILE_EXTS[type]) || []).flat().map(item => `.${item}`)
const exts = isCustom ? (fileConfig.allowed_file_extensions || []) : (allowedFileTypes?.map(type => FILE_EXTS[type]) || []).flat().map(item => `.${item}`)
const accept = exts.join(',')
return (