diff --git a/src/main/java/com/telpo/dipperposition/service/impl/DipperAstPosAsyncTaskServiceImpl.java b/src/main/java/com/telpo/dipperposition/service/impl/DipperAstPosAsyncTaskServiceImpl.java index eea974f..c122805 100644 --- a/src/main/java/com/telpo/dipperposition/service/impl/DipperAstPosAsyncTaskServiceImpl.java +++ b/src/main/java/com/telpo/dipperposition/service/impl/DipperAstPosAsyncTaskServiceImpl.java @@ -67,14 +67,19 @@ public class DipperAstPosAsyncTaskServiceImpl implements IDipperAstPosAsyncTaskS dataMap.put("ip", ipAddress); dataMap.put("key", ipPositionRequestKey); StringBuffer buffer = okHttpUtil.getQueryString(ipPositionRequestPath, dataMap); - if (ObjectUtils.isNotEmpty(buffer)) { - String provinceBuffer = buffer.toString(); - if (StringUtils.isEmpty(provinceBuffer)) { + JSONObject paramObject = new JSONObject(); + String result = okHttpUtil.postJsonParams(buffer.toString(), paramObject.toJSONString()); + if (ObjectUtils.isNotEmpty(result)) { + if (StringUtils.isEmpty(result)) { log.debug("IP省份获取错误,结果为空"); return null; } else { - log.debug("IP省份获取错误,结果为:" + provinceBuffer); - JSONObject provinceJson = JSONObject.parseObject(provinceBuffer); + if (result.equals("FAIL")) { + log.debug("IP省份获取错误,结果为FAIL"); + return null; + } + log.debug("IP省份获取错误,结果为:" + result); + JSONObject provinceJson = JSONObject.parseObject(result); String province = (String)provinceJson.get("province"); if (ObjectUtils.isEmpty(province)) { log.debug("json is :" + buffer.toString());