| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.Base64; |
| | | |
| | |
| | | * @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"; |
| | |
| | | jsonObject.put("idNumber",idcard); |
| | | jsonObject.put("realName",name); |
| | | String param=jsonObject.toJSONString(); |
| | | log.info("请求公安实名认证接口,请求地址:" + URL); |
| | | log.info("请求公安实名认证接口,请求参数:" + param); |
| | | 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; |