this.ctxCamera.stopRecord({
success: (res) => {
let formData = new FormData();
formData.append("user_id", "jokerE92");
formData.appendFile("files", res.tempVideoPath, "录播视频")
let data = formData.getData();
wx.request({
url: 'http://aaa.com/upload', //仅为示例,非真实的接口地址
header: {
'content-type': data.contentType
},
data: data.buffer,
method: 'POST',
success(res) {
const data = res.data
//do something
},
fail(e) {
console.log(e)
}
})
})
wx.request的timeout默认为60000毫秒
用这个