收藏
回答

订阅消息发送用户收到了,但是调用返回出错,请问是什么原因?

订阅消息请求参数: {

  "touser": "owdMa5EAUynaORgidxALOuqrfjhc",

  "template_id": "DXMhbrFhf8EYN8Vh3LwfnprXLAgo2Or4crnnd_cexYk",

  "page": "pages/guild-war/user-login",

  "data": {

    "thing1": {

      "value": "灵魂角鹿"

    },

    "number4": {

      "value": 13

    },

    "time3": {

      "value": "2026-02-03 19:20:29"

    }

  }

}

// 发送订阅消息
const sendResult = await cloud.openapi.subscribeMessage.send({
    touser: openid,
    template_id: notifyType.templateId,
    page: 'pages/guild-war/user-login',
    data: content
})

2026-02-03T11:20:30.125Z  通知处理错误: {

  message: 'openapi.subscribeMessage.send:fail -501001 resource system error. Unexpected token { in JSON at position 2',

  stack: 'Error: openapi.subscribeMessage.send:fail -501001 resource system error. Unexpected token { in JSON at position 2\n' +

    '    at toSDKError (/var/user/node_modules/wx-server-sdk/index.js:8175:19)\n' +

    '    at Object.returnAsFinalCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:8146:12)\n' +

    '    at callWXOpenAPI (/var/user/node_modules/wx-server-sdk/index.js:2513:27)\n' +

    '    at processTicksAndRejections (node:internal/process/task_queues:96:5)\n' +

    '    at async sendMessage (/var/user/index.js:313:40)\n' +

    '    at async handleBossRefresh (/var/user/index.js:580:37)\n' +

    '    at async exports.main (/var/user/index.js:650:28)',

  code: undefined,

  time: '2026-02-03T11:20:30.125Z'

}

回答关注问题邀请回答
收藏

1 个回答

  • 智能回答 智能回答 本次回答由AI生成
    9小时前
    有用
    回复
登录 后发表内容