【发布时间】:2018-01-03 03:21:13
【问题描述】:
我已经构建了一个返回图像的 REST API,并且我成功地通过 PostMan 代理获得了它的响应。 在我的 React 代码中,我有这个:
return fetch(url, sInit)
.then((response) => {
let blb = new Blob([response.body], { type: 'image/jpeg' });
let fileUrl = (window.URL || window.webkitURL).createObjectURL(blb);
window.open(fileUrl);
})
生成的 blob url 没有图片。我错过了什么?
【问题讨论】: