ios使用wx.choosevideo选择相册视频文件上传后台接收不到上传信息怎么解决
tapName(){
wx.chooseVideo({
compressed: true,
sourceType: [‘album’, ‘camera’],
maxDuration: 60,
success: res => {
console.log(res)
if (res.tempFilePath){
const uploadTask = wx.uploadFile({
url: ’ ',
name: ‘file’,
filePath: res.tempFilePath,
formData: { openid: ‘x’, title: “123”, duration: res.duration,},
header: {
“content-type”: “multipart/form-data”,
},
// ios 11.2.5
success: data => {
// console.log(data);
console.log(data);
if (JSON.parse(data.data).code==200){
wx.showToast({
title: ‘上传成功’,
})
}else{
wx.showToast({
title: JSON.parse(data.data).msg,
})
}
},
fail: res => {
console.log(res);
}
});
uploadTask.onProgressUpdate(res => {//监听上传进度条
// console.log(res);
console.log(res)
});
}
},
fail: (res) => {
uni.showToast({
icon: “none”,
title: “亲,您取消了!”
})
}
})
},