我上传文件到云托管的对象存储,提示以下错误:
我是uniapp获取图片上传到云托管对象存储的,没有什么云开发
Error: errCode: -501000 | errMsg: [100003] env not exists (8f08462d-0db7-4a61-8e7d-b1c68d8fdc9d)
at new C (:1:162605)
at success (:1:173751)
at Function.success (WAServiceMainContext.js?t=wechat&s=1694760802616&v=2.30.4:1)
at p (WAServiceMainContext.js?t=wechat&s=1694760802616&v=2.30.4:1)
at Object.success (WAServiceMainContext.js?t=wechat&s=1694760802616&v=2.30.4:1)
at i (WAServiceMainContext.js?t=wechat&s=1694760802616&v=2.30.4:1)
at yu (WAServiceMainContext.js?t=wechat&s=1694760802616&v=2.30.4:1)
at Su (WAServiceMainContext.js?t=wechat&s=1694760802616&v=2.30.4:1)
at WAServiceMainContext.js?t=wechat&s=1694760802616&v=2.30.4:1
at s (WAServiceMainContext.js?t=wechat&s=1694760802616&v=2.30.4:1)(env: macOS,mp,1.06.2308291; lib: 2.30.4)
上传代码:
wx.cloud.uploadFile({
cloudPath: 'example.png', // 对象存储路径,根路径直接填文件名,文件夹例子 test/文件名,不要 / 开头
filePath: file.url, // 微信本地文件,通过选择图片,聊天文件等接口获取
config: {
env: 'prod-xxxxx' // 需要替换成自己的微信云托管环境ID
}
}).then(res => {
console.log(res.fileID)
}).catch(error => {
console.error(error)
})