1.安装json-bigint插件
npm install json-bigint
2.加入如下transformResponse配置即可
import JSONBig from 'json-bigint' const config = {
baseURL: "",
timeout: 30 * 1000,
withCredentials: true,
transformResponse:[
function (data:any) {
const json = JSONBig({
storeAsString: true
})
return json.parse(data)
}
]
};