更新文件上传时请求参数
This commit is contained in:
@@ -206,13 +206,16 @@ function upload(uri, data, file, showLoading = true, extParams = {}) {
|
||||
url: baseUrl + uri,
|
||||
formData: data,
|
||||
name: "file",
|
||||
filePath: file.path,
|
||||
filePath: file.path||file.url,
|
||||
header: getHeader()
|
||||
}, extParams)
|
||||
).then((httpData) => {
|
||||
// uni.upload 返回bodyData 的是 string类型。 需要解析。
|
||||
httpData.data = JSON.parse(httpData.data)
|
||||
return Promise.resolve(httpData)
|
||||
}).catch(err=>{
|
||||
uni.hideLoading()
|
||||
infoBox.showErrorToast(`上传失败`)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user