1. 设置全局参数:
// 获取全局变量
AppId= postman.getGlobalVariable("AppId")
V= postman.getGlobalVariable("V")
openId= postman.getGlobalVariable("openId")
SignMethod= postman.getGlobalVariable("SignMethod")
Timestamp= postman.getGlobalVariable("Timestamp")
//设置当前时间戳
// postman.setGlobalVariable("Timestamp",Math.round(new Date().getTime()));
// Timestamp = postman.getGlobalVariable('Timestamp')
//字符串进行md5加密
var str = "1f4606532edd46cebd89c2d5eb9eb266"+"AppId"+AppId+"openId"+openId+"SignMethod"+SignMethod+"Timestamp"+Timestamp+"V"+V+ "1f4606532edd46cebd89c2d5eb9eb266";
var strmd5= CryptoJS.MD5(str).toString().toUpperCase();
postman.setGlobalVariable("sign",strmd5)