From f88e3b9709a9915f3104ef2b48025b650637e23a Mon Sep 17 00:00:00 2001 From: luozhun <2025254074@qq.com> Date: Thu, 28 Nov 2024 17:22:57 +0800 Subject: [PATCH] =?UTF-8?q?refactor(task):=20=E4=BC=98=E5=8C=96=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=20Security=20=E5=85=B3=E8=81=94=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -将 token 参数从请求头移至 URL 中 - 简化了请求构建过程,提高了代码可读性 --- .../changhu/task/SecurityAssociationDockingServiceTask.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/policeSecurityServer/src/main/java/com/changhu/task/SecurityAssociationDockingServiceTask.java b/policeSecurityServer/src/main/java/com/changhu/task/SecurityAssociationDockingServiceTask.java index ca7bd6c..05b797b 100644 --- a/policeSecurityServer/src/main/java/com/changhu/task/SecurityAssociationDockingServiceTask.java +++ b/policeSecurityServer/src/main/java/com/changhu/task/SecurityAssociationDockingServiceTask.java @@ -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()) {