Postman把语言转换设置变量
1//把responseBody 装カjson字符串
var data = JSON. parse ( responseBody);
if (data. token) {
tests["Body has token"] = true;
var token = 'Bearer ' + data. token;
pos tman. setEnvironmentVariable("token", token);
}
else {
tests["Body has token"] = false;
}