Use case description :
Log in with the current timestamp , take request body And user check code MD5 Code encryption , As the user's digital signature sent to the server for verification , Login after verification .
**Pre-request Script** // Set current timestamp ( millisecond ) Timestamp = Math.round(new
Date().getTime()); postman.setGlobalVariable("Timestamp",Timestamp); // Set signature key
key = "E84F708A9B8B42E6A08F9025CBBCC934"; // String md5 encryption var
token=pm.request.headers.get("Token")||""; var body=pm.request.body.raw; body =
body.replace("{{Timestamp}}",Timestamp); // Calculate signature var str =
token+"&"+body+"&"+key; postman.setGlobalVariable("str",str); var strmd5=
CryptoJS.MD5(str).toString(CryptoJS.enc.Hex).toUpperCase();
postman.setGlobalVariable("SignKey",strmd5);
Body Script parameter setting :
{ "UserName":"1", "Password":"123", "Timestamp":{{Timestamp}} }
Header Script parameter setting :
Content-Type:application/json SignKey:{{SignKey}}
Send Post execution results :
Token:"FFAF14FA7F2E404F9316BACB660BD121" TransReturnCode:"0"
TransReturnMessage:""

Technology
Daily Recommendation