// 假设后端返回的数据是图片文件流
const response = /* 后端返回的图片文件流 */;
// 创建 Blob 对象
const blob = new Blob([response], { type: 'image/jpeg' }); // 根据实际情况设置 MIME 类型
// 创建临时的 URL
const imageUrl = URL.createObjectURL(blob);
imageUrl 就是图片的url
// 假设后端返回的数据是图片文件流
const response = /* 后端返回的图片文件流 */;
// 创建 Blob 对象
const blob = new Blob([response], { type: 'image/jpeg' }); // 根据实际情况设置 MIME 类型
// 创建临时的 URL
const imageUrl = URL.createObjectURL(blob);
imageUrl 就是图片的url