Browse Source

AddressUtils修改

gao.qiang 1 year ago
parent
commit
06e297a249

+ 3 - 0
base-common/src/main/java/com/ozs/common/utils/ip/AddressUtils.java

@@ -38,14 +38,17 @@ public class AddressUtils
             {
                 log.error("url------------ {}", IP_URL+"?ip=" + ip + "&json=true");
                 String rspStr = HttpClientUtil.get(IP_URL+"?ip=" + ip + "&json=true");
+                log.error("rspStr------------ {}", rspStr);
                 if (StringUtils.isEmpty(rspStr))
                 {
                     log.error("获取地理位置异常 {}", ip);
                     return UNKNOWN;
                 }
                 JSONObject obj = JSON.parseObject(rspStr);
+                log.error("obj------------ {}", obj);
                 //String region = obj.getString("pro");
                 String city = obj.getString("city");
+                log.error("city------------ {}", city);
                 return String.format("%s",  city);
             }
             catch (Exception e)