Postman
Postman
Workspaces
new
HTTP
GRPC
WebSocket
environments
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
pm.test("Reuest Status ",function() {
pm.response.to.have.status(200);
});
var requestJson = pm.response.json();
// console.log("获取参数",requestJson);
if (requestJson.En == 0){
var UserInfo = JSON.parse(CryptoJS.enc.Base64.parse(requestJson.Data).toString(CryptoJS.enc.Utf8))
console.log("userInfo :",UserInfo)
pm.environment.set("UserId", UserInfo.UserId);
pm.environment.set("Token", UserInfo.Token);
tests["Login"] = true
}else{
tests["Login"] = "登录失败"+requestJson.En
}
This post is licensed under
CC BY 4.0
by the author.