开发者工具中请求后端接口,在response中 返回的数据正确,但是在preview中解析出来数据对象的不正确
比如:
response返回:
{
"code": 0,
"success": true,
"data": {
"records": [
{
"id": 111686870731063340,
"code": "SS202409100000044",
"mainId": 111686870731063332,
"mainCodes": "OR202409100000036",
"storeInfo": {
"id": 94649620231094273
},
"goodsList": [
{
"id": 111686870731063340,
"spec": {
"id": 106045843504627722
},
"goodsId": 106045843504627716
}
],
"merchantId": 94649620231094273,
"virtualStoreId": 0
},
{
"id": 111686870731063341,
"code": "SS202409100000045",
"mainId": 111686870731063332,
"mainCodes": "OR202409100000036",
"storeInfo": {
"id": 94649620231094273
},
"goodsList": [
{
"id": 111686870731063341,
"spec": {
"id": 106045843504627721
},
"goodsId": 106045843504627716
}
],
"merchantId": 94649620231094273,
"virtualStoreId": 94935909866143755
},
{
"id": 111686875026030638,
"code": "SS202409100000046",
"mainId": 111686875026030629,
"mainCodes": "OR202409100000037",
"storeInfo": {
"id": 76376497186668546
},
"goodsList": [
{
"id": 111686875026030638,
"spec": {
"id": 102394193590091829
},
"goodsId": 102394193590091780
}
],
"merchantId": 76376497186668546,
"virtualStoreId": 94935909866143755
},
{
"id": 111686793421652011,
"code": "SS202409100000043",
"mainId": 111686793421652003,
"mainCodes": "OR202409100000035",
"storeInfo": {
"id": 76376497186668546
},
"goodsList": [
{
"id": 111686793421652011,
"spec": {
"id": 102394193590091829
},
"goodsId": 102394193590091780
}
],
"merchantId": 76376497186668546,
"virtualStoreId": 94935909866143755
},
{
"id": 111686793421652009,
"code": "SS202409100000041",
"mainId": 111686793421652002,
"mainCodes": "OR202409100000034",
"storeInfo": {
"id": 94649620231094273
},
"goodsList": [
{
"id": 111686793421652009,
"spec": {
"id": 106045843504627722
},
"goodsId": 106045843504627716
}
],
"merchantId": 94649620231094273,
"virtualStoreId": 0
},
{
"id": 111686793421652010,
"code": "SS202409100000042",
"mainId": 111686793421652002,
"mainCodes": "OR202409100000034",
"storeInfo": {
"id": 94649620231094273
},
"goodsList": [
{
"id": 111686793421652010,
"spec": {
"id": 106045843504627721
},
"goodsId": 106045843504627716
}
],
"merchantId": 94649620231094273,
"virtualStoreId": 94935909866143755
},
{
"id": 111684701772578856,
"code": "SS202409100000040",
"mainId": 111684701772578849,
"mainCodes": "OR202409100000033",
"storeInfo": {
"id": 76376497186668546
},
"goodsList": [
{
"id": 111684701772578856,
"spec": {
"id": 103513870089322521
},
"goodsId": 102079338127556617
}
],
"merchantId": 76376497186668546,
"virtualStoreId": 94935909866143755
},
{
"id": 111684701772578853,
"code": "SS202409100000037",
"mainId": 111684701772578848,
"mainCodes": "OR202409100000032",
"storeInfo": {
"id": 94649620231094273
},
"goodsList": [
{
"id": 111684701772578853,
"spec": {
"id": 106045843504627722
},
"goodsId": 106045843504627716
}
],
"merchantId": 94649620231094273,
"virtualStoreId": 0
},
{
"id": 111684701772578854,
"code": "SS202409100000038",
"mainId": 111684701772578848,
"mainCodes": "OR202409100000032",
"storeInfo": {
"id": 94649620231094273
},
"goodsList": [
{
"id": 111684701772578854,
"spec": {
"id": 106045843504627721
},
"goodsId": 106045843504627716
}
],
"merchantId": 94649620231094273,
"virtualStoreId": 94935909866143755
},
{
"id": 111684701772578855,
"code": "SS202409100000039",
"mainId": 111684701772578849,
"mainCodes": "OR202409100000033",
"storeInfo": {
"id": 76376497186668546
},
"goodsList": [
{
"id": 111684701772578855,
"spec": {
"id": 103884061910499329
},
"goodsId": 103884061910499329
}
],
"merchantId": 76376497186668546,
"virtualStoreId": 94935909866143755
}
],
"total": 0,
"size": 10,
"current": 1,
"pages": 0
},
"msg": "操作成功",
"error": false
}
上面数据来自response粘贴出来的。
但是,在network 的preview中显示为:
id 和 mainId被解析错误。
比如records[1].id=111686870731063341
但是被解析为records[1].id=records[0].id=111686870731063340
其他也是如此。
与问题无关提一嘴,超长数字你最好用字符串。精度啊,32位啊,这些你都要考虑