let timestamp = (new Date()).getTime().toString();
timestamp = timestamp.substr(0,10);
//设置集合的全局变量
pm.collectionVariables.set("timestamp", timestamp);
var key='LinkDuoo.Sign';
var signStr = key + timestamp;
console.log("signStr :"+signStr);
//md5加密
var signature=CryptoJS.MD5(signStr).toString();
console.log("signature:"+signature);
pm.collectionVariables.set("signature", signature);
//获取当前时间
let timestamp = (new Date()).getTime().toString();
//取前十位
timestamp = timestamp.substr(0,10);
pm.globals.set("timestamp", timestamp);
//md5加密字符串
key = postman.getGlobalVariable("YuOu.Momtime.Sign");
var strmd5 = CryptoJS.MD5(key+timestamp).toString();文章来源:https://www.toymoban.com/news/detail-540444.html
pm.globals.set("signature", strmd5);文章来源地址https://www.toymoban.com/news/detail-540444.html
//获取当前时间
let timestamp = (new Date()).getTime().toString();
//取前十位
timestamp = timestamp.substr(0,10);
pm.globals.set("timestamp", timestamp);
//md5加密字符串
key = postman.getGlobalVariable("YuOu.Momtime.Sign");
var strmd5 = CryptoJS.MD5(key+timestamp).toString();
pm.globals.set("signature", strmd5);
到了这里,关于postman md5加密传输的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!