代码如下:
请求都不走进success里面,每次都直接进入fail,和complete里面,也不发出请求,请问这是小程序的bug嘛?
chooseimage: function () {
var that = this;
wx.chooseImage({
count: 4, // 默认9
sizeType: [‘original’], // 可以指定是原图还是压缩图,默认二者都有
sourceType: [‘album’, ‘camera’], // 可以指定来源是相册还是相机,默认二者都有
success: function (res) {
// 返回选定照片的本地文件路径列表,tempFilePath可以作为img标签的src属性显示图片
console.log(‘res’, res)
var tempFilePaths = res.tempFilePaths;
console.log(“tempFilePaths”, tempFilePaths)
wx.uploadFile({
url: ‘https://api-dev.lewaimai.com/customer/common/helper/uploadimage’,
filePath: tempFilePaths[0],
name: ‘file’,
formData: {
},
success: function (res) {
console.log(‘success’,res)
var data = res.data
},
fail:function(res){
console.log(‘fail’, res)
},
complete:function(res){
console.log(‘complete’, res)
}
})
}
})
},
res Object {errMsg: “chooseImage:ok”, tempFilePaths: Array[1], tempFileSizes: Array[1]}
indextest.js [sm]:27 tempFilePaths [“wxfile://tmp_2045657002o6zAJs9aI4hmjPwS2a-4SLTxOzHE62bf89aa726da5e9532c90439337a08b.jpg”]
indextest.js [sm]:40
fail Object {errMsg: “uploadFile:fail exceed max upload connection count 10”}
indextest.js [sm]:43
complete Object {errMsg: “uploadFile:fail exceed max upload connection count 10”}errMsg: “uploadFile:fail exceed max upload connection count 10”__proto__: Object