收藏
回答

调用openapi报错: error code: -604101"

框架类型 问题类型 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: '成功!' }

}


})


最后一次编辑于  2019-04-06
回答关注问题邀请回答
收藏

2 个回答

  • 兜儿里有棵桐
    兜儿里有棵桐
    2019-04-07

    把开发者工具更新到开发或者测试版最新版就可以了

    开发者工具 >= 1.02.1903251 (目前需开发版测试版

    2019-04-07
    有用 1
    回复
  • zero
    zero
    2019-04-07

    感谢,我昨晚搞到一点,更新了开发版搞定了,beta 1.02.1903251这个版本不行,我本身开始就是这个版本,改开发版后就可以了。

    2019-04-07
    有用
    回复
登录 后发表内容