mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-08 06:59:26 +08:00
fix(client): fix file type matching when file or property is null (#5659)
This commit is contained in:
parent
9a83a4e9b6
commit
e65d1887bd
@ -60,11 +60,14 @@ export class AttachmentFileTypes {
|
|||||||
export const attachmentFileTypes = new AttachmentFileTypes();
|
export const attachmentFileTypes = new AttachmentFileTypes();
|
||||||
|
|
||||||
export function matchMimetype(file: FileModel | UploadFile<any>, type: string) {
|
export function matchMimetype(file: FileModel | UploadFile<any>, type: string) {
|
||||||
if ('originFileObj' in file) {
|
if (!file) {
|
||||||
return match(file.type, type);
|
return false;
|
||||||
}
|
}
|
||||||
if ('mimetype' in file) {
|
if ((<UploadFile>file).originFileObj) {
|
||||||
return match(file.mimetype, type);
|
return match((<UploadFile>file).type, type);
|
||||||
|
}
|
||||||
|
if ((<FileModel>file).mimetype) {
|
||||||
|
return match((<FileModel>file).mimetype, type);
|
||||||
}
|
}
|
||||||
if (file.url) {
|
if (file.url) {
|
||||||
const [fileUrl] = file.url.split('?');
|
const [fileUrl] = file.url.split('?');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user