// 1 、 在接口请求处使用 JSONbig ,
import JSONbig from 'json-bigint';
transformResponse: [
function transformResponse(data) {
if (typeof data === 'string') {
try {
data = JSONbig.parse(data);
} catch (e) {}
}
return data;
},
],
2 、data 打印出来是一个普通对象,然后就报错 data.hasOwnProperty is not a function
if (data.hasOwnProperty('profile')) {}
import JSONbig from 'json-bigint';
transformResponse: [
function transformResponse(data) {
if (typeof data === 'string') {
try {
data = JSONbig.parse(data);
} catch (e) {}
}
return data;
},
],
2 、data 打印出来是一个普通对象,然后就报错 data.hasOwnProperty is not a function
if (data.hasOwnProperty('profile')) {}