Commit 7a28eb65 authored by tanyang's avatar tanyang

优化登录问题

parent 6ff0a5bb
...@@ -20,14 +20,20 @@ public class AddressUtils { ...@@ -20,14 +20,20 @@ public class AddressUtils {
public static final String UNKNOWN = "XX XX"; public static final String UNKNOWN = "XX XX";
public static String getRealAddressByIP(String ip) { public static String getRealAddressByIP(String ip) {
if (StringUtils.isBlank(ip)) { try {
return UNKNOWN; if (StringUtils.isBlank(ip)) {
return UNKNOWN;
}
// 内网不查询
ip = "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : HtmlUtil.cleanHtmlTag(ip);
if (NetUtil.isInnerIP(ip)) {
return "内网IP";
}
return RegionUtils.getCityInfo(ip);
} catch (Exception e) {
log.error("IP地址异常 "+ip);
e.printStackTrace();
} }
// 内网不查询 return null;
ip = "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : HtmlUtil.cleanHtmlTag(ip);
if (NetUtil.isInnerIP(ip)) {
return "内网IP";
}
return RegionUtils.getCityInfo(ip);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment