问题模块 | 框架类型 | 问题类型 | API/组件名称 | 终端类型 | 微信版本 | 基础库版本 |
---|---|---|---|---|---|---|
API和组件 | 小程序 | Bug | templateMessage.send | 客户端 | 7.0.3 | 2.6.4 |
按照官方示例写了云函数调用模板消息,也设置了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: '成功!' }
}
})
网友回复
同样遇到这个问题,按照官方文档配置了config.json文件,依然提示没有权限调用API