Browse Source

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

pull/20382/head
Rustin 5 years ago
committed by 偏右
parent
commit
92169c4853
  1. 2
      components/upload/__tests__/upload.test.js
  2. 5
      components/upload/utils.tsx

2
components/upload/__tests__/upload.test.js

@ -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 = {

5
components/upload/utils.tsx

@ -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)) {

Loading…
Cancel
Save