init project

This commit is contained in:
ldj_willow
2022-07-07 16:54:01 +08:00
parent fe41d039b6
commit 2e42cda88b
6 changed files with 5 additions and 206 deletions

View File

@@ -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");