云开发,模版消息报错,templateMessage.send,501001什么情况?
发布于 5 年前 作者 oyang 2006 次浏览 来自 官方Issues

{"errorCode":1,"errorMessage":"user code exception caught","stackTrace":"errCode: -501001 resource system error | errMsg: getOpenData:fail source.on is not a function; at getOpenData api; "}

{ action: 'getOpenData',

openData:

{ list:

[ '25_Rt-GB2xMTxJi5Hb_Z548eoBHqrtfPBCjXBy4UhJk5I7DVXxpSCBcNCzMUhM' ] },

userInfo:

{ appId: 'wx1e6acdbd04edfd2f',

openId: 'okH_90DrM3pIhNB8ennkCbNW4Gqs' } }

Error: errCode: -501001 resource system error | errMsg: getOpenData:fail source.on is not a function; at getOpenData api;

at new CloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6366:28)

at returnAsCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6418:16)

at Object.returnAsFinalCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6432:13)

at Cloud.<anonymous> (/var/user/node_modules/wx-server-sdk/index.js:2218:41)

at step (/var/user/node_modules/tslib/tslib.js:136:27)

at Object.throw (/var/user/node_modules/tslib/tslib.js:117:57)

at rejected (/var/user/node_modules/tslib/tslib.js:108:69)

at <anonymous>

async function sendTMPosition(event) {
  const { OPENID } = cloud.getWXContext()
  console.log(event)
  const sendResult = await cloud.openapi.templateMessage.send({
    touser: 'okH_90DrM3pIhNB8ennkCbNW4Gqs',
    templateId: 'rCOQ3dMcgmxUX1cwowZUbE2Wmni6Fj5LxxKQ_XXyN5E',
    formId: event.formId,
    data: {
      keyword1: { value: '产品经理'},
      keyword2: { value: '2019 年 1 月 1 日'},
    }
  })
  console.log(result)
  return sendResult
}
回到顶部