upload: fix upload not support ico file type issue(#20360) (#20375)

This commit is contained in:
Rustin 2019-12-22 17:23:08 +08:00 committed by 偏右
parent 74082defe9
commit 92169c4853
2 changed files with 5 additions and 2 deletions

View File

@ -188,7 +188,7 @@ describe('Upload', () => {
});
});
it('should increase percent automaticly when call autoUpdateProgress in IE', done => {
it('should increase percent automatically when call autoUpdateProgress in IE', done => {
let uploadInstance;
let lastPercent = -1;
const props = {

View File

@ -73,7 +73,10 @@ export const isImageUrl = (file: UploadFile): boolean => {
}
const url: string = (file.thumbUrl || file.url) as string;
const extension = extname(url);
if (/^data:image\//.test(url) || /(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg)$/i.test(extension)) {
if (
/^data:image\//.test(url) ||
/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i.test(extension)
) {
return true;
}
if (/^data:/.test(url)) {