Skip to content

Upload组件中,图片的URL后缀名为.do类型的时候,显示框的icon是一个file icon,而不是图片的缩略图 #1766

@chengzhiping

Description

@chengzhiping
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.4.10

Environment

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36

Reproduction link

https://github.com/vueComponent/ant-design-vue.git

Steps to reproduce

在给Upload组件传值defaultFileList对象中设置url为.do类型的后缀名(非常规的jpg, jpeg, gif等等后缀名)时,代码如下
<a-upload
.....
:defaultFileList="fileList"

export default {
data() {
return {
fileList: [
{
uid: '-1',
name: 'xxx.png',
status: 'done',
url: 'xxx.do',
}
],
};
},
};

What is expected?

期望能正常显示图片

What is actually happening?

图片显示为一个file icon。而不是图片。


查找到是在这个文件中/ant-design-vue/es/upload/UploadList.js中isImageUrl方法中会检测图片url的后缀名,如果不是常规图片后缀名,return false, 但是图片中也有一种形式,通过后端.do接口返回数据流。而数据流是图片。这里可以改造或者可配置?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions