ä¿修复获取客户端IP返回多个ip的问题

This commit is contained in:
fang 2022-03-23 20:12:49 +08:00
parent c1de1113c4
commit de793ec01d
1 changed files with 3 additions and 1 deletions

View File

@ -40,7 +40,9 @@ public class IpUtils
ip = request.getRemoteAddr();
}
return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
ip = "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
ip = ip.split(",")[0].trim();
return ip;
}
public static boolean internalIp(String ip)