diff --git a/WebContent/WEB-INF/web.xml b/WebContent/WEB-INF/web.xml index 57664b8..2370c37 100644 --- a/WebContent/WEB-INF/web.xml +++ b/WebContent/WEB-INF/web.xml @@ -175,6 +175,6 @@ - 10 + 30 \ No newline at end of file diff --git a/WebContent/WEB-INF/weblogic-web.xml b/WebContent/WEB-INF/weblogic-web.xml index 20461dc..c8af68a 100644 --- a/WebContent/WEB-INF/weblogic-web.xml +++ b/WebContent/WEB-INF/weblogic-web.xml @@ -145,6 +145,6 @@ - 10 + 30 \ No newline at end of file diff --git a/WebContent/jsp/common/include/script.jsp b/WebContent/jsp/common/include/script.jsp index 70653d1..f2d99fd 100644 --- a/WebContent/jsp/common/include/script.jsp +++ b/WebContent/jsp/common/include/script.jsp @@ -31,8 +31,12 @@ "> "> "> "> diff --git a/WebContent/jsp/common/screen/emergency.jsp b/WebContent/jsp/common/screen/emergency.jsp index e85c537..b2eacc2 100644 --- a/WebContent/jsp/common/screen/emergency.jsp +++ b/WebContent/jsp/common/screen/emergency.jsp @@ -305,11 +305,13 @@ }); $("input[name=changePassword]").keydown(function(event){ if ( event.which == 13 ) { + event.preventDefault(); submitChangePassword(); } }); $("input[name=confirmPassword]").keydown(function(event){ if ( event.which == 13 ) { + event.preventDefault(); submitChangePassword(); } }); diff --git a/WebContent/jsp/common/screen/main.jsp b/WebContent/jsp/common/screen/main.jsp index e1e027d..e230073 100644 --- a/WebContent/jsp/common/screen/main.jsp +++ b/WebContent/jsp/common/screen/main.jsp @@ -166,10 +166,8 @@ location.href = '<%=request.getContextPath()%>/rms/logout.do'; } - /* 상위 프레임(main.jsp) 활동 감지 */ - ['mousemove', 'keydown', 'click', 'touchstart'].forEach(function (e) { - document.addEventListener(e, markActivity, true); - }); + /* 상위 프레임(main.jsp)에서 발생하는 AJAX 요청만 활동으로 기록 (마우스 이동/클릭만으로는 갱신되지 않음) */ + $(document).ajaxSend(markActivity); /* 주기적 유휴 시간 체크 */ setInterval(function () { diff --git a/WebContent/jsp/common/screen/top_04.jsp b/WebContent/jsp/common/screen/top_04.jsp index debed51..6a9ed54 100644 --- a/WebContent/jsp/common/screen/top_04.jsp +++ b/WebContent/jsp/common/screen/top_04.jsp @@ -555,7 +555,35 @@ <% session.setAttribute("dualLogin", "N"); %> } - }); + }); + + // 세션(자동로그아웃) 타임아웃 카운트다운 - main.jsp의 유휴시간 판단과 동일한 sessionStorage 값을 공유한다. + (function () { + var IDLE_MS = ${autoLogoutTimeout} * 60 * 1000; + + function getLastActivity() { + var t = sessionStorage.getItem('lastActivity'); + return t ? parseInt(t, 10) : Date.now(); + } + + function formatRemain(ms) { + if (ms < 0) ms = 0; + var totalSec = Math.floor(ms / 1000); + var mm = Math.floor(totalSec / 60); + var ss = totalSec % 60; + return (mm < 10 ? '0' + mm : mm) + ':' + (ss < 10 ? '0' + ss : ss); + } + + function updateSessionTimeoutTimer() { + var remain = IDLE_MS - (Date.now() - getLastActivity()); + $('#sessionTimeoutTimer').text('세션 만료까지 ' + formatRemain(remain)); + } + + $(function () { + updateSessionTimeoutTimer(); + setInterval(updateSessionTimeoutTimer, 1000); + }); + })(); @@ -568,11 +596,12 @@