From de91c84954157bb9f8b6d938cbe0b1b51fb6e65d Mon Sep 17 00:00:00 2001 From: CeDo <cedoogle@gmail.com> Date: 星期五, 07 五月 2021 15:23:57 +0800 Subject: [PATCH] bugfixed:新增便民服务商家 报错 --- springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/RealNameUtil.java | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/RealNameUtil.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/RealNameUtil.java index 1b80f46..c6375b7 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/RealNameUtil.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/RealNameUtil.java @@ -1,6 +1,7 @@ package com.panzhihua.common.utlis; import com.alibaba.fastjson.JSONObject; +import lombok.extern.slf4j.Slf4j; import java.util.Base64; @@ -10,6 +11,7 @@ * @author: huang.hongfa weixin hhf9596 qq 959656820 * @create: 2021-01-08 09:45 **/ +@Slf4j public class RealNameUtil { private static final String CLIENT_ID="2092261934651932672"; private static final String SECRET="de1c0dbb-9197-4724-9cc2-aa94e30a072f"; @@ -32,7 +34,11 @@ jsonObject.put("idNumber",idcard); jsonObject.put("realName",name); String param=jsonObject.toJSONString(); + log.info("请求公安实名认证接口,请求地址:" + URL); + log.info("请求公安实名认证接口,请求参数:" + param); + log.info("请求公安实名认证接口,请求头参数:" + headervalue + encodeToString); String postByJson = HttpClientUtil.sendPostByJson(URL, param, 0, headerkey, headervalue + encodeToString); + log.info("请求公安实名认证接口,返回参数:" + postByJson); int code = JSONObject.parseObject(postByJson).getIntValue("code"); if (0==code) { result =true; @@ -41,7 +47,7 @@ } public static void main(String[] args) { - boolean b = RealNameUtil.authentication("340823199112282557", "黄宏发f"); + boolean b = RealNameUtil.authentication("340823199112282557", "黄宏发"); System.out.println(b); } -- Gitblit v1.7.1