使用wx.cloud.uploadFile()一直报错
VM2013 WAService.js:2 Unhandled promise rejection Error: cloud.uploadFile:fail undefined . uploadFile:fail createUploadTask:fail file not found
wx.getUserProfile({
desc: ‘用于发布动态’,
success: (res) => {
console.log(res);
console.log(res.userInfo);
wx.cloud.uploadFile({
cloudPath: ‘userImage/’ + util.getRandName() + ‘.jpg’,
filePath: res.userInfo.avatarUrl
}).then(res => {
console.log(‘用户头像保存成功’);
})
},