- 当前 Bug 的表现(可附上截图)
uploadAndCutPic.js? [sm]:388 [上传文件] 失败: Error: errCode: -1 | errMsg: cloud.uploadFile:fail uploadFile:fail SSL handshake aborted: ssl=0x6d5bf058: I/O error during system call, Connection reset by peer; at cloud.uploadFile api;
74971-1/https://mmbiz.qlogo.cn/mmbiz_jpg/tAMFXp3GvnV8iaB6uib5xE80EkZN1AIfplpRn5UQAjIeP3g9K6COrVd5xWmibdEmGslCkgZXD081yl81MqDOOn9Rg/0?" border=0 >
- 预期表现
ios微信版本没有这个问题.
- 复现路径
- 提供一个最简复现 Demo
// 上传图片
doUpload: function () {
// 选择图片
wx.chooseImage({
count: 1,
sizeType: ['compressed'],
sourceType: ['album', 'camera'],
success: function (res) {
wx.showLoading({
title: '上传中',
})
const filePath = res.tempFilePaths[0]
// 上传图片
const cloudPath = 'my-image' + filePath.match(/\.[^.]+?$/)[0]
wx.cloud.uploadFile({
cloudPath,
filePath,
success: res => {
console.log('[上传文件] 成功:', res)
app.globalData.fileID = res.fileID
app.globalData.cloudPath = cloudPath
app.globalData.imagePath = filePath
wx.navigateTo({
url: '../storageConsole/storageConsole'
})
},
fail: e => {
console.error('[上传文件] 失败:', e)
wx.showToast({
icon: 'none',
title: '上传失败',
})
},
complete: () => {
wx.hideLoading()
}
})
},
fail: e => {
console.error(e)
}
})
},
本文网址:http://www.91bianli.com/weixinxiaochengxu/24525.html