dcloudio / dcloudio/uni-app

ios qq浏览器uploadFile 缺少参数

Open
#3,938 1 comment 0 reactions 1 assignee Claimed by @GRCmade View on GitHub
Dominant language
JavaScript
Stars
41.6k
Forks
3.7k
Avg merge
7h 6m
Merged PRs (30d)
6

Description

**问题描述**
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();
}
})
```
缺少参数,后端无法接受的file

设置
header: {
'Authorization': getStore('token'),
'content-type': 'multipart/form-data' // 无效还是 json
},

**复现步骤**
[复现问题的步骤]
使用qq直接打开网站

[或者可以直接贴源代码]

**预期结果**
上传成功

**实际结果**
上传缺少参数

**系统信息:**
iphoneX

**补充信息**
[可选]
[根据你的分析,出现这个问题的原因可能在哪里?]

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.