yanghb
2023-04-24 a7b4edc7bcefc976de1c8bf8d371f1f9428ec4ca
DriverTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/JuHeUtil.java
@@ -2,6 +2,7 @@
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;
@@ -32,7 +33,12 @@
        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){
@@ -50,7 +56,12 @@
     */
    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){