报错如下:
2021-02-13 19:23:16,951 ERROR 13938 [-/undefined/-/30004ms POST /node-jielong/record/sendMsg]
err: RequestError: Error: Client network socket disconnected before secure TLS connection was established
at new RequestError (/data/jielong-node/node_modules/_request-promise-core@1.1.4@request-promise-core/lib/errors.js:14:15)
at Request.plumbing.callback (/data/jielong-node/node_modules/_request-promise-core@1.1.4@request-promise-core/lib/plumbing.js:87:29)
at Request.RP$callback [as _callback] (/data/jielong-node/node_modules/_request-promise-core@1.1.4@request-promise-core/lib/plumbing.js:46:31)
at self.callback (/data/jielong-node/node_modules/_request@2.88.2@request/request.js:185:22)
at Request.emit (events.js:315:20)
at Request.onRequestError (/data/jielong-node/node_modules/_request@2.88.2@request/request.js:877:8)
at ClientRequest.emit (events.js:315:20)
at TLSSocket.socketErrorListener (_http_client.js:469:9)
at TLSSocket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
cause: Error: Client network socket disconnected before secure TLS connection was established
at connResetException (internal/errors.js:607:14)
at TLSSocket.onConnectEnd (_tls_wrap.js:1544:19)
at TLSSocket.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'ECONNRESET',
path: null,
host: 'api.weixin.qq.com',
port: 443,
localAddress: undefined
},
error: Error: Client network socket disconnected before secure TLS connection was established
at connResetException (internal/errors.js:607:14)
at TLSSocket.onConnectEnd (_tls_wrap.js:1544:19)
at TLSSocket.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'ECONNRESET',
path: null,
host: 'api.weixin.qq.com',
port: 443,
localAddress: undefined
},
options: {
method: 'POST',
json: true,
body: {
touser: 'oXDf-w-oVJXu8-YT2yaB',
template_id: 'btUuZJgjtPejADpVqRyMBL6gcY_cZocwc',
miniprogram: [Object],
data: [Object]
},
callback: [Function: RP$callback],
transform: undefined,
simple: true,
resolveWithFullResponse: false,
transform2xxOnly: false
},
response: undefined
}
小程序模板消息已经弃用,请使用订阅消息:https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.send.html