| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.stylefeng.guns.modular.system.util.httpClinet.HttpClientUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | map.put("key", key); |
| | | map.put("idcard", idcard); |
| | | map.put("realname", name); |
| | | String content = httpClientUtil.pushHttpRequset("GET", "http://op.juhe.cn/idcard/query", map, new HashMap<>(), "form"); |
| | | String content = null; |
| | | try { |
| | | content = httpClientUtil.pushHttpRequset("GET", "http://op.juhe.cn/idcard/query", map, new HashMap<>(), "form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println(content); |
| | | JSONObject jsonObject = JSON.parseObject(content); |
| | | if(jsonObject.getIntValue("error_code") == 0){ |
| | |
| | | */ |
| | | public Map<String, String> queryBank(String code){ |
| | | String url = "http://apis.juhe.cn/interbank/query?key=" + key + "&bankcard=" + code; |
| | | String get = httpClientUtil.pushHttpRequset("GET", url, null, null, "form"); |
| | | String get = null; |
| | | try { |
| | | get = httpClientUtil.pushHttpRequset("GET", url, null, null, "form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(get); |
| | | Map<String, String> map = new HashMap<>(); |
| | | if(jsonObject.getIntValue("error_code") == 0){ |