로그인된 상태에서 홈페이지 접근하면 자동로그인 되도록 변경
eapim-admin CI / build (push) Has been cancelled

This commit is contained in:
eastargh
2026-09-17 11:18:48 +09:00
parent c3ad216ac9
commit daa82084e8
3 changed files with 73 additions and 8 deletions
@@ -0,0 +1,33 @@
<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%--
이미 로그인된 세션으로 loginForm.do 에 접근한 경우의 bounce 화면.
serviceType은 서버(세션)에 지속 저장되는 값이 아니라 브라우저 localStorage에만 있으므로,
루트 emergency.jsp와 동일하게 여기서 localStorage를 읽어 main.do URL에 붙여준다.
(없이 넘어가면 이 탭의 sessionStorage.serviceType이 비어 custom.js의 $.ajax 자동주입 값이
비게 되어, 새 탭에서 연 화면의 조회 API 호출들이 serviceType 없이 나간다)
--%>
<!DOCTYPE html>
<html>
<head>
<script language="javascript">
var contextPath = "<%=request.getContextPath()%>";
var mainPage = "${mainPage}";
var serviceType = localStorage["serviceType"];
var mainUrl = contextPath + "/main.do";
var params = [];
if (mainPage) {
params.push("mainPage=" + encodeURIComponent(mainPage));
}
if (serviceType) {
params.push("serviceType=" + encodeURIComponent(serviceType));
}
if (params.length > 0) {
mainUrl += "?" + params.join("&");
}
window.location.replace(mainUrl);
</script>
</head>
</html>