fix(front): handle wildcard file type acceptance in FileUpload component to improve file upload flexibility

This commit is contained in:
keven1024
2025-04-28 12:32:01 +08:00
parent 65f67f98f8
commit 1137e6c692

View File

@@ -22,6 +22,9 @@ const { isOverDropZone } = useDropZone(dropZoneRef, {
dataTypes: (types) => {
for (const type of types) {
for (const acceptType of accept.value.split(',')) {
if (acceptType === '*') {
return true
}
if (acceptType?.endsWith('*')) {
const [acceptTypePrefix,] = acceptType?.split('/')
if (!acceptTypePrefix) {