zl程序教程

您现在的位置是:首页 >  前端

当前栏目

postman加密和使用当前时间戳

postman加密 时间 当前 使用
2023-09-27 14:27:49 时间

// 获取全局变量
uid = postman.getGlobalVariable(“uid”)
sid = postman.getGlobalVariable(“sid”)

//设置当前时间戳
postman.setGlobalVariable(“time”,Math.round(new Date().getTime()));
time = postman.getGlobalVariable(‘time’)

//设置KEY_WORD为全局变量
postman.setGlobalVariable(“Key”,"******")
KEY_WORD = postman.getGlobalVariable(“Key”);

//字符串进行md5加密
var str = uid+sid+time+KEY_WORD;
var strmd5= CryptoJS.MD5(str).toString();
postman.setGlobalVariable(“sign”,strmd5)