一、效果图
二、主要代码
export function 接口(params) {
return request({
url: `urlurlurl`,
method: 'get',
params,
responseType: 'blob',
isExport: true,
})
}
<img
style="width: 170px; height: 117px; border-radius: 10px"
:src="businessLicenseUrl"
class="avatar"
/>
接口(参数).then(res => {
this.businessLicenseUrl = window.URL.createObjectURL(res.data)
//businessLicenseUrl就是blob对象
//:blob:http://localhost:8080/5a5a092a-93c8-4ba8-9918-4329b112a2ec
})