//解析返回值
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参数设置
- 新增变量:
- 变量调用