This commit is contained in:
aihe 2024-05-11 13:43:39 +08:00
parent 3a7e023e7f
commit de716c4acf

View File

@ -74,10 +74,15 @@ async function handleResponse({
param, param,
coreParams coreParams
}) { }) {
// 图片类型数据特殊处理 // 图片类型数据特殊处理
if(header['content-type']?.indexOf?.("image/") > -1) { if((header['content-type'] || header['Content-Type'])?.indexOf?.("image/") > -1) {
const base64 = "data:image/png;base64," + uni.arrayBufferToBase64(data) const base64 = "data:image/png;base64," + uni.arrayBufferToBase64(data)
let { tempFilePath } = await downloadFile(base64) let tempFilePath = base64
try{
let dFile = await downloadFile(base64)
tempFilePath = dFile.tempFilePath
}catch(e){
}
resolve({ data: { fileUrl: tempFilePath } }) resolve({ data: { fileUrl: tempFilePath } })
return return
} }