wx.chooseVideo({
maxDuration: 60,
compressed: false,
success: function(res) {
var tempFilePath = res.tempFilePath;
wx.uploadFile({
url: 'http://dfsfds',
filePath: tempFilePath,
name: 'file',
formData: {
'folder': 'test'
},
header: {
'content-type': 'application/json',
'Authorization': wx.getStorageSync('token')
},
success(res) {
var data = JSON.parse(res.data);
console.log(res.data)
if(data.code==200){
that.setData({
load_video1: data.data, //素材图片
})
}else{
wx.showToast({
title: data.msg,
icon: "none"
})
}
},
fail(res){
wx.showToast({
title: res,
icon: "none"
})
}
})
}
})