var cloud = new wx.cloud({
resourceAppid:'wx5d8d765e252720eb',
resourceEnv:'production-rjntq'
})
cloud.init()
Error: errCode: -1 | errMsg: Cloud API isn’t enabled, please call wx.cloud.init first
请先调用 wx.cloud.init() 完成初始化后再调用其他云 API。
at new u (VM446 WAService.js:2)
at Object.exportAPI.<computed> (VM446 WAService.js:2)
at Object.p.<computed> [as callFunction] (VM446 WAService.js:2)
at _callee3$ (user.js:30)
at f (VM446 WAService.js:2)
at Generator.u._invoke (VM446 WAService.js:2)
at Generator.next (VM446 WAService.js:2)
at asyncGeneratorStep (asyncToGenerator.js:1)
at c (asyncToGenerator.js:1)
at asyncToGenerator.js:1
参考文章:
https://developers.weixin.qq.com/miniprogram/dev/wxcloud/guide/resource-sharing/
如果我换个写法
wx.cloud.init({
resourceAppid:'wx5d8d765e252720eb',
resourceEnv:'production-rjntq'
})
报错就是
VM685:1 Error: invalid scope 没有权限,请先开通云服务
at Function.fail (VM691 WAService.js:2)
at h (VM691 WAService.js:2)
at Object.fail (VM691 WAService.js:2)
at v (VM691 WAService.js:2)
at VM691 WAService.js:2
at e.<anonymous> (VM690 asdebug.js:1)
at h (VM691 WAService.js:2)
at VM691 WAService.js:2
at VM691 WAService.js:2