Skip to content

Commit be4e062

Browse files
[fix](playground) Fixed bigint display problem in doris playground (#49053)
1 parent e6c3068 commit be4e062

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

ui/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
"react-router-dom": "^5.2.0",
4747
"react-syntax-highlighter": "^12.2.1",
4848
"rxjs": "^7.0.0-beta.0",
49-
"sql-formatter": "^2.3.3"
49+
"sql-formatter": "^2.3.3",
50+
"json-bigint": "^1.0.0"
5051
},
5152
"devDependencies": {
5253
"@typescript-eslint/eslint-plugin": "^2.24.0",

ui/src/utils/request.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ import {Trans} from 'react-i18next';
2929
import {getBasePath} from 'Src/utils/utils';
3030
import SyntaxHighlighter from 'react-syntax-highlighter';
3131
import {docco} from 'react-syntax-highlighter/dist/esm/styles/hljs';
32+
33+
const JSONbig = require('json-bigint')({ storeAsString: true });
3234
function checkStatus(response) {
3335
if (response.status >= 200 && response.status < 300) {
3436
return response;
@@ -116,7 +118,8 @@ export default async function request(url, options = {}, tipSuccess = false, tip
116118
if (options && options.download) {
117119
return response.blob();
118120
}
119-
const data = await response.json();
121+
const text = await response.text();
122+
const data = JSONbig.parse(text);
120123
if ('code' in data || 'msg' in data) {
121124
const {code, msg} = data;
122125
if (code === 401 && data.data === 'Cookie is invalid') {
@@ -166,4 +169,4 @@ function clearAllCookie() {
166169
for(var i = keys.length; i--;)
167170
document.cookie = keys[i] + '=0;expires=' + new Date(0).toUTCString()
168171
}
169-
}
172+
}

0 commit comments

Comments
 (0)