- 部分手机 uploadFile:fail Write error: ssl=0xb5609300 ?
wx.uploadFile 接口在部分手机上出现 uploadFile:fail Write error: ssl=0xb5609300 : I/O error during system call, Connection reset 其他接口正常调用,同一个机器APP端普通接口与上传图片接口都能正常调用 ssl证书检测地址:https://myssl.com/portal.chinayanghe.com:443 请问如果是证书问题我该往哪方面调整 /** * 上传图片到服务器 * @param filePath */ uploadFileToServer: async function(filePath) { const {address} = this.data; const {extData = {}} = this.properties; const formData = {...address, ...extData}; const AuthenToken = await getCookie(COOKIE_KEY_TOKEN); const commHeader = await getCookie(COOKIE_KEY_COMM_HEADER); const url = baseUrl + uploadCertImg + "?" + Object.keys(formData).map(key => key + "=" + formData[key]).join("&"); wx.uploadFile({ url, filePath, name: 'file', header: { AuthenToken, ...commHeader, "Content-Type": "multipart/form-data;charset=UTF-8" }, success: (res) => { const data = JSON.parse(res.data || "{}"); const {code, data: imgData, status, exception, msg} = data; const {picUrl} = imgData; if (code !== 0) { this.uploadFail(msg); } else { this.changeImage(picUrl, imgData); } }, fail: err => this.uploadFail((err || {}).errMsg), complete: () => this.hideLoading() }) },
2019-11-05 - 某些机型微信小程序上传图片出错,但是app可以。
代码: /** * 上传图片到服务器 * @param filePath */ uploadFileToServer: async function(filePath) { const {address} = this.data; const {extData = {}} = this.properties; const formData = {...address, ...extData}; const AuthenToken = await getCookie(COOKIE_KEY_TOKEN); const commHeader = await getCookie(COOKIE_KEY_COMM_HEADER); const url = baseUrl + uploadCertImg + "?" + Object.keys(formData).map(key => key + "=" + formData[key]).join("&"); wx.uploadFile({ url, filePath, name: 'file', header: { AuthenToken, ...commHeader, "Content-Type": "multipart/form-data;charset=UTF-8" }, success: (res) => { const data = JSON.parse(res.data || "{}"); const {code, data: imgData, status, exception, msg} = data; const {picUrl} = imgData; if (code !== 0) { this.uploadFail(msg); } else { this.changeImage(picUrl, imgData); } }, fail: err => this.uploadFail((err || {}).errMsg), complete: () => this.hideLoading() }) },[图片]
2019-11-05