上传两张图片报错uploadFile:fail createUploadTask
同时上传两张图片时报错,但是去年这个代码是可以运行的。
错误内容:
VM290:1 uploadFile:fail createUploadTask:fail exceed max upload connection count 1
代码:
function Promisify (fn) { return function (obj = {}) { return new Promise((resolve, reject) => { obj.success = function (res) { resolve(res) } obj.fail = function (res) { reject(res) } fn(obj) }) } } // 上传图片 function uploadIdCardImg (filepath) { return Promisify(wx.uploadFile)({ url: `${BASE_URL}/upload`, filePath: filepath, name: 'picture' }) } // 开始上传 function submit(){ return Promise.all([ uploadIdCardImg(filePath1), uploadIdCardImg(filePath2) ]) } |
1 回复