fix: can not find file (#23472)
This commit is contained in:
@@ -68,6 +68,7 @@ export const useFile = (fileConfig: FileUpload) => {
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
case SupportUploadFileTypes.custom:
|
||||||
case SupportUploadFileTypes.document: {
|
case SupportUploadFileTypes.document: {
|
||||||
if (fileSize > docSizeLimit) {
|
if (fileSize > docSizeLimit) {
|
||||||
notify({
|
notify({
|
||||||
@@ -107,19 +108,6 @@ export const useFile = (fileConfig: FileUpload) => {
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
case SupportUploadFileTypes.custom: {
|
|
||||||
if (fileSize > docSizeLimit) {
|
|
||||||
notify({
|
|
||||||
type: 'error',
|
|
||||||
message: t('common.fileUploader.uploadFromComputerLimit', {
|
|
||||||
type: SupportUploadFileTypes.document,
|
|
||||||
size: formatFileSize(docSizeLimit),
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
default: {
|
default: {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@@ -231,7 +219,7 @@ export const useFile = (fileConfig: FileUpload) => {
|
|||||||
url: res.url,
|
url: res.url,
|
||||||
}
|
}
|
||||||
if (!isAllowedFileExtension(res.name, res.mime_type, fileConfig.allowed_file_types || [], fileConfig.allowed_file_extensions || [])) {
|
if (!isAllowedFileExtension(res.name, res.mime_type, fileConfig.allowed_file_types || [], fileConfig.allowed_file_extensions || [])) {
|
||||||
notify({ type: 'error', message: `${t('common.fileUploader.fileExtensionNotSupport')} ${file.type}` })
|
notify({ type: 'error', message: `${t('common.fileUploader.fileExtensionNotSupport')} ${newFile.type}` })
|
||||||
handleRemoveFile(uploadingFile.id)
|
handleRemoveFile(uploadingFile.id)
|
||||||
}
|
}
|
||||||
if (!checkSizeLimit(newFile.supportFileType, newFile.size))
|
if (!checkSizeLimit(newFile.supportFileType, newFile.size))
|
||||||
|
Reference in New Issue
Block a user