idea 下载安装 Http Client 插件
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/a24fbf33f2f84c5fbd15cbf1891b0b98.png)
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/62812800341e42ef8ad2fe6bc86ded54.png)
指定环境
{
"local": {
"url": "http://localhost:8080"
}
}
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/9856f7d2334e4fef9e4182f7c85a12eb.png)
编写接口
POST {{url}}/test/login
Content-Type: application/json
// 请求体参数
{
"account": "xxxxx",
"name": "xxxxx"
}
> {%
// 打印
client.log(response.body);
// 取出返回结果的token,设置全局token
client.global.set("token", response.body.data.token);
%}
// 返回结果
{
"success": true,
"data": {
"token": "9C1594CA1ECBD44389DD50439E4A02324A8ADE089330A7D4185ECB292010120339698D03338B6A7D6609CBAF7DEE3F8A"
},
"traceId": "c0a8007517043487546851005d1abc",
"env": "dev"
}
GET {{url}}/nuc/account/hall/getUserInfo
token:{{token}}