const cloud = require(‘wx-server-sdk’)
cloud.init()
exports.main = async (event, context) => {
try {
const result = await cloud.openapi.wxacode.getUnlimited({
scene: event.type+"&"+event.did + “&” + event.data+"&"+event.value
})
console.log(result)
return result
} catch (err) {
console.log(err)
return err
}
}
异常报错 604101错误 说没有权限,这个小程序码生成函数是一定要发布了才可以调用吗
2019-06-07T03:42:40.285Z 4c410274-88d6-11e9-8e18-5254005d5fdb { Error: errCode: -604101 function has no permission to call this API | errMsg: system error: error code: -604101
at new CloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6173:28)
at Object.<anonymous> (/var/user/node_modules/wx-server-sdk/index.js:479:39)
at step (/var/user/node_modules/tslib/tslib.js:133:27)
at Object.next (/var/user/node_modules/tslib/tslib.js:114:57)
at fulfilled (/var/user/node_modules/tslib/tslib.js:104:62)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
errCode: -604101,
errMsg: 'system error: error code: -604101' }