post
程序员文章站
2022-07-13 08:54:05
...
var token;
var loginBody = {};
loginBody.method = "com.yuyuka.billiards.api.openid.login";
loginBody.channelCode = "h5_api_get";
loginBody.timestamp = "12123";
loginBody.bizContent = "{\"openId\":\"obuTr5ptkCU6tCVJ7iDKQehSwqpo\"}";
var signStr = loginBody.channelCode + loginBody.bizContent+"EqlgPZWo";
var sign = CryptoJS.MD5(signStr);
loginBody.sign = sign.toString();
const loginUser = {
url: 'http://127.0.0.1:8081/api/gateway',
method: 'POST',
header: ['Content-Type: application/json'],
body: JSON.stringify(loginBody)
};
console.log("请求登录 :" + JSON.stringify(loginBody));
pm.sendRequest(loginUser, function (err, res) {
var bizContent = JSON.parse(res.json().bizContent);
var body = JSON.parse(pm.request.body.raw);
var signStr = body.channelCode + body.bizContent+"EqlgPZWo";
var sign = CryptoJS.MD5(signStr);
console.log("sign " + sign);
console.log("token : " + bizContent.token);
pm.environment.set("sign", sign.toString());
pm.environment.set("userToken", bizContent.token);
});
{
"method":"com.yuyuka.billiards.api.authorized.vip.consume.log.list",
"channelCode":"h5_api_get",
"timestamp":"123123",
"bizContent":"{}",
"deviceInfo":"deviceInfo",
"sign":"{{sign}}",
"token":"{{userToken}}"
}
上一篇: 记录一次稽核数据的过程
下一篇: 变量之间的相关性度量