Browse Source

bigInt bug fix

zhangjie 5 years ago
parent
commit
9979b9570b
1 changed files with 7 additions and 3 deletions
  1. 7 3
      src/plugins/utils.js

+ 7 - 3
src/plugins/utils.js

@@ -226,9 +226,13 @@ function calcSum(dataList) {
  * @param {String} text json格式字符串
  */
 function jsonBigNumberToString(text) {
-  return text.replace(/:[0-9]{16,19}/g, function(match) {
-    return match[0] + '"' + match.slice(1) + '"';
-  });
+  return text
+    .replace(/\\":[0-9]{16,19}/g, function(match) {
+      return match.slice(0, 3) + '\\"' + match.slice(3) + '\\"';
+    })
+    .replace(/:[0-9]{16,19}/g, function(match) {
+      return match[0] + '"' + match.slice(1) + '"';
+    });
 }
 
 export {