uni.request({
url: imageUrl,
timeout: 8000,
responseType: 'arraybuffer',
success: (res)=>{
// 响应成功
if(res.statusCode == 200) {
let img_data = res.data;
// #ifdef H5
let contentType = this.$util.getContentTypeByUrl(imageUrl);
let blob = new Blob([img_data], {type: contentType});
this.imageSrc = URL.createObjectURL(blob);
// #endif
// #ifdef APP-PLUS
this.imageSrc = uni.arrayBufferToBase64(img_data)
// #endif
} else {
// 标记为错误状态
this.isError = true;
this.loading = false;
}
},
fail: (err)=>{
// 标记为错误状态
this.isError = true;
this.loading = false;
}
})
2 个回复
FullStack - 【插件开发】【专治疑难杂症】【ios上架、马甲包、白包、过审、已成功上架过几百个】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=22130】【非诚勿扰】QQ:543610866
视频都可以转,https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-uni-app-doc/a876efc0-4f35-11eb-97b7-0dc4655d6e68.mp4
没有报:request entity too large
DCloud_iOS_XHY
如果开启了调试的话把调试关闭在试试看,调试的时候是浏览器环境的限制