【fix sonar】IPUtils文件

This commit is contained in:
梁琦涛
2023-03-09 17:35:55 +08:00
parent 18d87f91bc
commit 3425c8a95c
@@ -50,12 +50,10 @@ public class IPUtils {
logger.error("IPUtils ERROR ", e);
}
// //使用代理,则获取第一个IP地址
// if(StringUtils.isEmpty(ip) && ip.length() > 15) {
// if(ip.indexOf(",") > 0) {
// ip = ip.substring(0, ip.indexOf(","));
// }
// }
//使用代理,则获取第一个IP地址
if(!StringUtils.isEmpty(ip) && ip.length() > 15 && ip.contains(",")) {
ip = ip.substring(0, ip.indexOf(","));
}
return ip;
}