postman获得时间戳和md5加密的方法

  • 注意点:记得用postman.setGlobalVariable设置全局变量,不然{ {strmd5}}这种变量取不到值
    postman获得时间戳和md5加密的方法_第1张图片
var appid = "123";
var key = "123";

var timestamp =  Math.round(new Date().getTime());
var result = timestamp.toString().substring(0,10);

postman.setGlobalVariable("timestamp",result);

var strmd5 = CryptoJS.MD5("appid="+appid+"×tamp_str="+result+"&key="+key).toString().toUpperCase().toString();

postman.setGlobalVariable("strmd5",strmd5)

console.log(strmd5)

postman获得时间戳和md5加密的方法_第2张图片

你可能感兴趣的:(软件测试)