按照官方示例写了云函数调用模板消息,也设置了openapi权限,就是报错,求救!!!
报错信息:
errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID 6f3eb878-5881-11e9-abc7-5254005d5fdb, cloud function service error code -504002, error message errCode: -604101 function has no permission to call this API | errMsg: system error: error code: -604101; at cloud.callFunction api;
- 当前 Bug 的表现(可附上截图)

代码和权限设置如下:



const result = await cloud.openapi.templateMessage.send({
touser: cloud.getWXContext().OPENID,
page: 'index',
templateId: event.templateid,
formId: event.formid,
emphasisKeyword: event.emphasisKeyword,
data: {
keyword1: { value: '339208499' },
keyword2: { value: '2019年8月8日' },
keyword3: { value: '广州市海珠区新港中路397号' },
keyword4: { value: '标点符号历险记' },
keyword5: { value: '2015年01月05日' },
keyword6: { value: '成功!' }
}
})
微信小程序开发问题解答
微信小程序开发者回答:
把开发者工具更新到开发版或者测试版最新版就可以了
开发者工具 >= 1.02.1903251 (目前需开发版或测试版)
本文网址:http://www.91bianli.com/weixinxiaochengxu/9967.html