From e5c937396de5a43ba25a07247ccf4494f4f12c26 Mon Sep 17 00:00:00 2001 From: Netfan Date: Sat, 24 May 2025 13:01:58 +0800 Subject: [PATCH] fix: json-bigint parse used in vxeTable (#6271) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修复vxeTable不能加载json-bigint解析的数据的问题 --- playground/src/api/request.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/playground/src/api/request.ts b/playground/src/api/request.ts index e1e9e4f4..e741552d 100644 --- a/playground/src/api/request.ts +++ b/playground/src/api/request.ts @@ -12,6 +12,7 @@ import { RequestClient, } from '@vben/request'; import { useAccessStore } from '@vben/stores'; +import { cloneDeep } from '@vben/utils'; import { message } from 'ant-design-vue'; import JSONBigInt from 'json-bigint'; @@ -29,7 +30,9 @@ function createRequestClient(baseURL: string, options?: RequestClientOptions) { transformResponse: (data: any, header: AxiosResponseHeaders) => { // storeAsString指示将BigInt存储为字符串,设为false则会存储为内置的BigInt类型 return header.getContentType()?.toString().includes('application/json') - ? JSONBigInt({ storeAsString: true }).parse(data) + ? cloneDeep( + JSONBigInt({ storeAsString: true, strict: true }).parse(data), + ) : data; }, });