接口返回值(模拟的停车卡列表数据,合计3条)
{
"code": 200,
"msg": "ok",
"item": {
"total": 3,
"to": 3,
"data": [
{
"id": 23452,
"stop_card_number": "鄂ARSPKT(燃油)",
"status": "否",
},
{
"id": 21653,
"stop_card_number": "粤B254124(燃油)",
"status": "是",
},
{
"id": 21652,
"stop_card_number": "粤B23568(燃油)",
"status": "否",
}
]
}
}
目标:从该接口的返回值中获取status = "是" 的记录,并将id和stop_card_number 两个字段设置为环境变量。
预期结果:id = 21653 的记录设置为环境变量
实现方案:利用Apifox 或postman的后置操作,增加自定