import org.apache.commons.codec.digest.DigestUtils;
//导入org.apache.commons.codec.digest.DigestUtils;
String timeStamp = "${__time(/1000,)}";
//定义时间timeStamp=服务器时间;
String randomStr = "${__Random(11111111,99999999)}";
//定义时间随机数=8位1-9的随机数;
String tmp = timeStamp + randomStr + "xxxxx";
//定义tmp=时间timeStamp,8位随机数和密码xxxxx;
log.info("timeStamp:" + timeStamp);
//打印timeStamp;
log.info("randomStr:" + randomStr);
//打印randomStr;
log.info("tmp:" + tmp);
//打印tmp;
//String un = DigestUtils.sha1Hex(tmp);
//定义un=哈希sha1加密的tmp;
//log.info("un:" + un);
//打印un;
String signature = DigestUtils.md5Hex (DigestUtils.sha1Hex(tmp)).toUpperCase();
//定义signature==哈希sha1加密的tmp然后再进行md5加密后进行大写;
log.info("signature:" + signature);
//打印signature;
vars.put("signature", signature);
//打印signature;
vars.put("timeStamp", timeStamp);
//打印timeStamp;
vars.put("randomStr", randomStr);
//打印randomStr;