1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
var token
var login_address
const loginRequestDev = {
url: 'http://dev.4dshoetech.local/backend/authcenter/login/login',
method: 'POST',
header: 'Content-Type: application/json',
body: {
mode: 'raw',
raw: JSON.stringify({"account":"junjie001@qq.com","pass":"Hello123","level":1,"inviteId":"","type":0})
}
}
const loginRequestSit = {
url: 'http://sit.4dshoetech.local/backend/authcenter/login/login',
method: 'POST',
header: 'Content-Type: application/json',
body: {
mode: 'raw',
raw: JSON.stringify({"account":"502","pass":"123456","level":1,"inviteId":"","type":0})
}
}
pm.sendRequest(loginRequestDev,function(err,res){
if(err) {
console.log(err)
} else {
var response = JSON.parse(res.text());
token = response.data.token
pm.globals.set("dev_token", token);
console.log(response.data.token);
}
});
pm.sendRequest(loginRequestSit,function(err,res){
if(err) {
console.log(err)
} else {
var response = JSON.parse(res.text());
token = response.data.token
pm.globals.set("sit_token", token);
console.log(response.data.token);
}
});
|