- 云开发,模版消息报错,templateMessage.send,501001什么情况?
{"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[代码][代码]}[代码]
2019-10-28 - 示例代码里面getOpenData提示这个错误什么意思,公共库大于2.8,openapi已经上传?
{"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>
2019-09-29