|
@@ -29,11 +29,15 @@ function createRequestClient(baseURL: string, options?: RequestClientOptions) {
|
|
|
baseURL,
|
|
baseURL,
|
|
|
transformResponse: (data: any, header: AxiosResponseHeaders) => {
|
|
transformResponse: (data: any, header: AxiosResponseHeaders) => {
|
|
|
// storeAsString指示将BigInt存储为字符串,设为false则会存储为内置的BigInt类型
|
|
// storeAsString指示将BigInt存储为字符串,设为false则会存储为内置的BigInt类型
|
|
|
- return header.getContentType()?.toString().includes('application/json')
|
|
|
|
|
- ? cloneDeep(
|
|
|
|
|
- JSONBigInt({ storeAsString: true, strict: true }).parse(data),
|
|
|
|
|
- )
|
|
|
|
|
- : data;
|
|
|
|
|
|
|
+ if (
|
|
|
|
|
+ header.getContentType()?.toString().includes('application/json') &&
|
|
|
|
|
+ typeof data === 'string'
|
|
|
|
|
+ ) {
|
|
|
|
|
+ return cloneDeep(
|
|
|
|
|
+ JSONBigInt({ storeAsString: true, strict: true }).parse(data),
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
|
|
+ return data;
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
|
|
|