diff --git a/hai-service/src/main/java/com/hai/common/utils/BaiduUtils.java b/hai-service/src/main/java/com/hai/common/utils/BaiduUtils.java index 7f8d8fb0..92bcfe42 100644 --- a/hai-service/src/main/java/com/hai/common/utils/BaiduUtils.java +++ b/hai-service/src/main/java/com/hai/common/utils/BaiduUtils.java @@ -21,9 +21,14 @@ public class BaiduUtils { * @return */ public static JSONObject ipLocation(String ip) { - JSONObject response = HttpsUtils.doGet("https://api.map.baidu.com/location/ip?ak=X4sSdXsohVOMb1tNiLZloD9ows5FaNjq&ip=" + ip); - log.info(response.toJSONString()); - return response; + if (ip != null) { + JSONObject response = HttpsUtils.doGet("https://api.map.baidu.com/location/ip?ak=X4sSdXsohVOMb1tNiLZloD9ows5FaNjq&ip=" + ip); + log.info(response.toJSONString()); + return response; + + } else { + return null; + } } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java index 69c01860..c3918ae1 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java @@ -267,7 +267,7 @@ public class HighDiscountAgentCodeServiceImpl implements HighDiscountAgentCodeSe useDiscount(discountAgentCodeId); } } catch (Exception e) { - + throw e; } finally { // 删除key,释放锁 redisTemplate.delete(key); diff --git a/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java index eaabdb3c..d89f2fdf 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java @@ -84,6 +84,7 @@ public class HighUserServiceImpl implements HighUserService { public SessionObject loginAndRegister(LoginPlatform platform,String phone, Long popularizeUserId, Map other,HttpServletRequest request, HttpServletResponse response) throws Exception { // 记录登录信息 String requestIp = RequestUtils.getRequestIp(); + System.out.println(requestIp); HighUserLoginLog loginLog = new HighUserLoginLog(); loginLog.setUserPhone(phone); loginLog.setPlatformCode(platform.getCode());