发布时间:2020-07-15编辑:佚名阅读(1210)
let secCheck = await new Promise<string>((resolve, reject) => { let postData = JSON.stringify({ content: p.content }); let options ={ hostname:'api.weixin.qq.com', path:'/wxa/msg_sec_check?access_token=' + access_token, method:'POST', headers:{ 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(postData) } } let req = https.request(options, res => { let dd = ''; res.on('data', secCheck => { dd += secCheck; }); res.on('end', secCheck => { resolve(dd); }) res.on('error', err => { reject(err); }); }); req.on('error', err => { console.log(4,err); reject(err); }); //记得这两句! req.write(postData); req.end(); });
下一篇:c#记录日志到文件
0人
0人
0人
0人