| | |
| | | package com.panzhihua.common.utlis; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.exceptions.ServiceException; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import java.util.Base64; |
| | |
| | | log.info("请求公安实名认证接口,请求地址:" + URL); |
| | | log.info("请求公安实名认证接口,请求参数:" + param); |
| | | log.info("请求公安实名认证接口,请求头参数:" + headervalue + encodeToString); |
| | | String postByJson = HttpClientUtil.sendPostByJson(URL, param, 0, headerkey, headervalue + encodeToString); |
| | | String postByJson = HttpClientUtil.sendPostByJson(URL, param, 2, headerkey, headervalue + encodeToString); |
| | | log.info("请求公安实名认证接口,返回参数:" + postByJson); |
| | | int code = JSONObject.parseObject(postByJson).getIntValue("code"); |
| | | if (0==code) { |
| | | result =true; |
| | | if(postByJson!=null) { |
| | | int code = JSONObject.parseObject(postByJson).getIntValue("code"); |
| | | if (0 == code) { |
| | | result = true; |
| | | } |
| | | }else{ |
| | | throw new ServiceException("公安实名认证接口超时,请重试"); |
| | | } |
| | | return result; |
| | | } |