问题描述
ios qq 调研上传后端无法获得参数,其他平台可以,imagePath 参数伟canvas 获得的base64
let input = this.dataURLtoFile(that.imagePath, 'file.png')
uni.uploadFile({
url: baseUrl '/file/oss/upload',
file:input,
header: {
'Authorization': getStore('token'),
},
formData: {
file:input
},
name: 'file',
success: (res) => {
var {
data
} = JSON.parse(res.data);
that.imageFile = data.link
console.log(that.imageFile, 'that.imageFile')
// that.OrderHandle();
},
fail:(res)=> {
// that.OrderHandle();
},
complete:()=> {
that.OrderHandle();
}
})
设置
header: {
'Authorization': getStore('token'),
'content-type': 'multipart/form-data' // 无效还是 json
},
复现步骤
[复现问题的步骤]
使用qq直接打开网站,调用上传失败
预期结果
上传成功
实际结果
上传缺少参数
系统信息:
iphoneX
ios15.6
0 个回复