1、使用Pre-request script 脚本
var moment = require('moment');
var data = moment().format("YYYY-MM-DD HH:mm:ss");
console.log(data);
var param1={"companyID":23,"parkID":8000207,"areaID":3};
postman.setGlobalVariable("param",param1);
param = postman.getGlobalVariable("param");
postman.setGlobalVariable("key","EGOVA_ZNBC_SIGNKEY_2015");
key = postman.getGlobalVariable("key");
new Date().
timestamp = postman.getGlobalVariable("data");
//设置当前时间戳
postman.setGlobalVariable("timestamp",Math.round(new Date().getTime()));
stamp = postman.getGlobalVariable('stamp');
//字符串进行md5加密
var str = param+stamp+key;
var strmd5= CryptoJS.MD5(str).toString().toUpperCase();
sign = postman.setGlobalVariable("sign",strmd5);