postman级联查询案例

//解析返回值
var res = JSON.parse(responseBody);

var apiSalt = res.apiSalt;
var serviceSalt = res.serviceSalt;

var redPacketActivityId = pm.environment.get("activityId");
//获取postman变量
var token = pm.environment.get("token");
var userId = pm.environment.get("userId");
//设置postman变量
pm.environment.set("apiSalt",res.apiSalt);
pm.environment.set("serviceSalt",res.serviceSalt);
//apiSalt=4&redPacketActivityId=3&serviceSalt=5&token=1&userId=2
var param = `apiSalt=${apiSalt}&redPacketActivityId=${redPacketActivityId}&serviceSalt=${serviceSalt}&token=${token}&userId=${userId}${apiSalt}`;

pm.environment.set("param",param);

var sign = CryptoJS.MD5(param).toString();

pm.environment.set("sign",sign);

pm postman固定常量
pm.environment postman参数设置

  1. 新增变量:
    新增变量
  2. 变量调用
    image.png
# html   java   js  

评论

企鹅群:39438021

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×