node-webot / co-wechat-api

Wechat API. Support Async Functions
Other
723 stars 170 forks source link

sendTemplate 接口返回 msgid 精度丢失 #89

Closed arronzhang closed 4 years ago

arronzhang commented 6 years ago

返回结果:

 {"errcode":0,"errmsg":"ok","msgid":271781022721654784}

由于数字太大了,JSON.parse 之后精度就丢失了,变成了 271781022721654800,目前request接口没提供预处理结果的方法,不好自己修正。

JacksonTian commented 6 years ago

271781022721654784 > Number.MAX_SAFE_INTEGER 是这样的。

我想想怎么处理比较好。

imerovingian commented 6 years ago
edit ->api_common.js
add ->const JSONbig = require('json-bigint');
modify ->try { data = JSONbig.parse(replaceJSONCtlChars(origin)); } 
JacksonTian commented 6 years ago

@imerovingian 来个 PR 吧