node-webot / co-wechat-api

Wechat API. Support Async Functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sendTemplate 接口返回 msgid 精度丢失

arronzhang opened this issue · comments

commented

返回结果:

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

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

271781022721654784 > Number.MAX_SAFE_INTEGER 是这样的。

我想想怎么处理比较好。

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

@imerovingian 来个 PR 吧