云存储无法上传图片,报错
上传失败 Error: errCode: -503002 storage permission denied | errMsg: Have no access right to the storage 环境代码: App({
onLaunch: function () {
wx.cloud.init({
env: 'cloud1-7gnxcazqca056a4a',
traceUser: true,
});
},
globalData: {
}
})
调度代码: uploadImg(imgUrl, buttonItem) {
let that = this
var timestamp = (new Date()).valueOf();
console.log('ocr/' + timestamp + '.png')
console.log(imgUrl)
wx.cloud.uploadFile({
cloudPath: timestamp + '.png',
filePath: imgUrl, // 文件路径
success: res => {
console.log("上传成功", res.fileID)
that.getImgUrl(res.fileID, buttonItem)
},
fail: err => {
console.log("上传失败", err)
}
})
},