refactor(task): 优化查询 Security 关联信息接口请求

-将 token 参数从请求头移至 URL 中
- 简化了请求构建过程,提高了代码可读性
This commit is contained in:
luozhun 2024-11-28 17:22:57 +08:00
parent 2e210d5435
commit f88e3b9709
1 changed files with 1 additions and 3 deletions

View File

@ -57,9 +57,7 @@ public class SecurityAssociationDockingServiceTask {
}
public JSONObject querySecurityNumberByIdCard(String idCard) {
HttpRequest request = HttpUtil.createPost(BASE_HOST + "/api/security/query");
//请求头参数
request.form("token", TOKEN);
HttpRequest request = HttpUtil.createPost(BASE_HOST + "/api/security/query?token=" + TOKEN);
//请求体参数
request.body(JSONObject.of("idcard", idCard).toJSONString());
try (HttpResponse response = request.execute()) {