Commit 61d9d6a2 authored by lvweichao's avatar lvweichao

update: nodejs handle bigInt

parent ffcd9670
......@@ -3922,6 +3922,11 @@
"integrity": "sha1-ZfCvOC9Xi83HQr2cKB6cstd2gyg=",
"dev": true
},
"bignumber.js": {
"version": "9.0.1",
"resolved": "https://registry.npm.taobao.org/bignumber.js/download/bignumber.js-9.0.1.tgz",
"integrity": "sha1-jXuhJMiCv9jkMmDGdHVRjQaJ5OU="
},
"binary-extensions": {
"version": "2.2.0",
"resolved": "https://registry.npm.taobao.org/binary-extensions/download/binary-extensions-2.2.0.tgz?cache=0&sync_timestamp=1610299322955&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbinary-extensions%2Fdownload%2Fbinary-extensions-2.2.0.tgz",
......@@ -10177,6 +10182,14 @@
"integrity": "sha1-gFZNLkg9rPbo7yCWUKZ98/DCg6Q=",
"dev": true
},
"json-bigint": {
"version": "1.0.0",
"resolved": "https://registry.npm.taobao.org/json-bigint/download/json-bigint-1.0.0.tgz",
"integrity": "sha1-rlR4I6wMrYOYZn+M2e9HMPWwH/E=",
"requires": {
"bignumber.js": "^9.0.0"
}
},
"json-buffer": {
"version": "3.0.0",
"resolved": "https://registry.npm.taobao.org/json-buffer/download/json-buffer-3.0.0.tgz",
......
......@@ -20,7 +20,7 @@ exports.httpReq = (ctx, opts) => {
console.info(`[Api] httpReq (${ctx.request.url}, user:[${opts.qs.op_cur_user}]) spent: ${+new Date() - time_start}ms`)
if (!err) {
resolve(body)
resolve(JSON.stringify(body))
} else {
reject(err)
console.error(opts.url, err)
......
import axios from "axios";
import store from "@/store"
import { v1 as uuidv1 } from 'uuid';
import jsonBig from 'json-bigint'
// import { ElMessage } from "element-plus";
// import { APP_URI } from "../config/app.config";
......@@ -98,7 +99,12 @@ instance.interceptors.response.use(
// showClose: true
// });
// }
return data;
try {
return jsonBig.parse(data);
} catch (err) {
console.log('转换失败', err)
return data;
}
},
// function (error) {
// if (!(error.code && error.code === -1)) error.message = "接口请求错误";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment