로그인시 IP정보 WEB_REQUEST_LOG에 저장 처리
parent
bd0c4633de
commit
472d907fba
|
|
@ -964,22 +964,22 @@ public class LoginController {
|
|||
// client ip
|
||||
System.out.println("XFF = " + request.getHeader("X-Forwarded-For"));
|
||||
System.out.println("REMOTE = " + request.getRemoteAddr());
|
||||
// clientIp = request.getHeader("X-Forwarded-For");
|
||||
// if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
||||
// clientIp = request.getHeader("Proxy-Client-IP");
|
||||
// }
|
||||
// if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
||||
// clientIp = request.getHeader("WL-Proxy-Client-IP");
|
||||
// }
|
||||
// if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
||||
// clientIp = request.getHeader("HTTP_CLIENT_IP");
|
||||
// }
|
||||
// if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
||||
// clientIp = request.getHeader("HTTP_X_FORWARDED_FOR");
|
||||
// }
|
||||
// if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
||||
// clientIp = request.getRemoteAddr();
|
||||
// }
|
||||
clientIp = request.getHeader("X-Forwarded-For");
|
||||
if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
||||
clientIp = request.getHeader("Proxy-Client-IP");
|
||||
}
|
||||
if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
||||
clientIp = request.getHeader("WL-Proxy-Client-IP");
|
||||
}
|
||||
if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
||||
clientIp = request.getHeader("HTTP_CLIENT_IP");
|
||||
}
|
||||
if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
||||
clientIp = request.getHeader("HTTP_X_FORWARDED_FOR");
|
||||
}
|
||||
if (clientIp == null || clientIp.length() == 0 || "unknown".equalsIgnoreCase(clientIp)) {
|
||||
clientIp = request.getRemoteAddr();
|
||||
}
|
||||
Enumeration<String> headerNames = request.getHeaderNames();
|
||||
while (headerNames.hasMoreElements()) {
|
||||
String name = headerNames.nextElement();
|
||||
|
|
|
|||
|
|
@ -85,8 +85,8 @@
|
|||
|
||||
<insert id="insertWebRequestLog">
|
||||
<![CDATA[
|
||||
INSERT INTO WEB_REQUEST_LOG (IDX,DATETIME,USERID,SESSION_ID)
|
||||
SELECT NVL(MAX(IDX), 0) + 1, SYSDATE, #{userid}, #{sessionid}
|
||||
INSERT INTO WEB_REQUEST_LOG (IDX,DATETIME,USERID,SESSION_ID,USERIP)
|
||||
SELECT NVL(MAX(IDX), 0) + 1, SYSDATE, #{userid}, #{sessionid}, #{userip}
|
||||
FROM WEB_REQUEST_LOG
|
||||
]]>
|
||||
</insert>
|
||||
|
|
|
|||
Loading…
Reference in New Issue