发送请求后,在响应体中直接显示二维码
// 相应结果转成json对象result
var data={
result: pm.response.json()
}
// 将数据中的qrcode解码后作为图片添加到标签img
var template = '<html><img src="data:image/jpg;base64, {{result.data.qrcode}}" width="200" height="200"></html>';
// 设置img标签可视化
pm.visualizer.set(template, data)
width和height按需设置,实测百分比失真
查看二维码
在响应体 body - Visualize 可见
备注:响应的数据结构
{
"data": {
"businessCode": "775328844184948736",
"status": 3,
"deptCode": "91320102724560399U",
"qrcode": "iVBORw0KG......base64str......JRU5ErkJggg==",
"appkey": null,
"signTheme": null,
"applyTime": "2022-11-10 12:00:01",
"updateTime": "2023-05-08 20:35:21"
},
"code": 0,
"message": "操作成功"
}