Boaz

vue js处理请求大于16位数字类型数据
1.npm i json-bigint2.定制 axios 配置项 transformResponse 处理返回结...
扫描右侧二维码阅读全文
06
2020/11

vue js处理请求大于16位数字类型数据

1.npm i json-bigint
2.定制 axios 配置项 transformResponse 处理返回结果

import JSONbig from 'json-bigint';
axios.defaults.transformResponse = [ config => JSONbig.parse(config)];

3.加工数据 toString()

ps:
因为后端返回的不是JSON对象数据在获取之前就丢失精度了、只能处理axios拦截数据、这种方法通用

Last modification:November 6th, 2020 at 04:01 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment