一、测试的接口:
二、postman进行测试:
//设置全局变量
postman.setGlobalVariable("timestamp",Math.round(new Date()/1000));
postman.setGlobalVariable("token","08b005d9b5cee80b55687a324ba1834a");
postman.setGlobalVariable("deviceId","1001");
//获取变量
timestamp = postman.getGlobalVariable("timestamp");
token = postman.getGlobalVariable("token");
deviceId = postman.getGlobalVariable("deviceId");
//sign:进行MD5加密
var sign = deviceId + token + timestamp;
var signmd5 = CryptoJS.MD5(sign).toString();
//signmd5设置成全局变量
postman.setGlobalVariable('signmd5',signmd5);
//输出日志
console.log("timestamp = "+timestamp);
console.log("token = "+token);
console.log("deviceId = "+deviceId);
console.log("sign = "+sign);
console.log("signmd5 = "+signmd5);