let text = this.data.text;
let img_item = this.data.arrs;//图片地址数组
console.log(img_item)
var formData = new FormData();
console.log(typeof(form))
for(let a= 0 ;a<img_item.length;a++){
console.log(a)
formData.append(“images[]”, img_item[a])
}
formData.append(“content”, text)
console.log(formData.getAll(“images[]”))
wx.request({
url: urls,//上传服务器的接口
method: “POST”,
header: {
“Content-Type”: “multipart/form-data”,
“DeviceId”: 310995000000000,
“access-token”: token,
},
data: formData,
dataType: “json”,
fail: function (res) {
console.log(“网络异常”)
},
success: function (res) {
console.log(res.data)
}
})
是不是content-type 需要改成什么样子的才能传成功?