wx.uploadFile 真机调试请求后台的上传接可以上传图片,但是体验版请求后台的上传接口超时?
wx.uploadFile({
url:settings.baseUrl +"/api/Wechar/uploadFile",
filePath: this.filePath,
name: "file",
formData:this.pageData,
header: {
"Content-Type": "multipart/form-data"
},
//成功
success: function success(res) {
console.log(res);
var data=JSON.parse(res.data)
if (data.success) {
uni.showModal({
title: '提示',
content: '签名保存成功',
confirmText: '确定',
showCancel: false,
})
}else{
uni.showModal({
title: "提示",
content: data.message,
showCancel: false
});
}
},
//失败
fail: function fail(e) {
uni.showModal({
title: "提示",
content: "上传失败:"+e.errMsg,
showCancel: false,
});
}
});