init project
This commit is contained in:
@@ -145,6 +145,11 @@ public class StringUtils {
|
||||
* 获取ip地址
|
||||
*/
|
||||
public static String getIp(HttpServletRequest request) {
|
||||
// TODO 不解析IP地址
|
||||
if(true){
|
||||
return "127.0.0.1";
|
||||
}
|
||||
|
||||
String ip = request.getHeader("x-forwarded-for");
|
||||
if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) {
|
||||
ip = request.getHeader("Proxy-Client-IP");
|
||||
|
||||
Reference in New Issue
Block a user