GGWEB/src/main/webapp/WEB-INF/jsp/layout/header.jsp

34 lines
1.4 KiB
Plaintext

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<script type="text/javascript">
$(document).on('click', '#logoutLink', function (){
$("#logoutForm").submit();
})
</script>
<c:set var="tilesURI" value="${requestScope['javax.servlet.forward.request_uri']}"/>
<c:set var="tilesURIParam" value="${requestScope['javax.servlet.forward.query_string']}"/>
<form id="logoutForm" action="/j_spring_security_logout" method="POST">
<input name="${_csrf.parameterName}" type="hidden" value="${_csrf.token}"/>
</form>
<header class="header">
<div class="header_title">
<sec:authorize access="hasRole('ROLE_USER')">
<a href="/map/request">모바일센터 관리시스템</a>
</sec:authorize>
<sec:authorize access="hasRole('ROLE_ADMIN')">
<a href="/admin/dashBoard">모바일센터 관리시스템</a>
</sec:authorize>
</div>
<sec:authorize access="hasAnyRole('ROLE_ADMIN','ROLE_USER')">
<div class="header_info">
<a id="logoutLink" href="#"><i class="bi bi-box-arrow-right"></i>로그아웃</a>
</div>
</sec:authorize>
</header>