refactor(task): 优化查询 Security 关联信息接口请求
-将 token 参数从请求头移至 URL 中 - 简化了请求构建过程,提高了代码可读性
This commit is contained in:
parent
2e210d5435
commit
f88e3b9709
|
@ -57,9 +57,7 @@ public class SecurityAssociationDockingServiceTask {
|
||||||
}
|
}
|
||||||
|
|
||||||
public JSONObject querySecurityNumberByIdCard(String idCard) {
|
public JSONObject querySecurityNumberByIdCard(String idCard) {
|
||||||
HttpRequest request = HttpUtil.createPost(BASE_HOST + "/api/security/query");
|
HttpRequest request = HttpUtil.createPost(BASE_HOST + "/api/security/query?token=" + TOKEN);
|
||||||
//请求头参数
|
|
||||||
request.form("token", TOKEN);
|
|
||||||
//请求体参数
|
//请求体参数
|
||||||
request.body(JSONObject.of("idcard", idCard).toJSONString());
|
request.body(JSONObject.of("idcard", idCard).toJSONString());
|
||||||
try (HttpResponse response = request.execute()) {
|
try (HttpResponse response = request.execute()) {
|
||||||
|
|
Loading…
Reference in New Issue