[Spring][쇼핑몰 프로젝트][10] 로그아웃 기능 구현(메인페이지)

https://kimvampa.tistory.com/135
This commit is contained in:
SeoJin Kim
2021-01-28 09:01:56 +09:00
parent aa633e1b75
commit d48fe83d4f
8 changed files with 59 additions and 2 deletions

View File

@@ -179,6 +179,21 @@ public class MemberController {
}
/* 메인페이지 로그아웃 */
@RequestMapping(value="logout.do", method=RequestMethod.GET)
public String logoutMainGET(HttpServletRequest request) throws Exception{
logger.info("logoutMainGET메서드 진입");
HttpSession session = request.getSession();
session.invalidate();
return "redirect:/main";
}
}

View File

@@ -37,6 +37,7 @@
<span>회원 : ${member.memberName}</span>
<span>충전금액 : <fmt:formatNumber value="${member.money }" pattern="\#,###.##"/></span>
<span>포인트 : <fmt:formatNumber value="${member.point }" pattern="#,###" /></span>
<a href="/member/logout.do">로그아웃</a>
</div>
</c:if>

View File

@@ -89,6 +89,18 @@
margin: 5% auto;
padding-top: 5%;
}
.login_success_area>a{
font-size: 15px;
font-weight: 900;
display: inline-block;
margin-top: 5px;
background: #e1e5e8;
width: 82px;
height: 22px;
line-height: 22px;
border-radius: 25px;
color: #606267;
}
.login_success_area>span{
display : block;
text-align: left;

View File

@@ -1,5 +1,5 @@
#Generated by Maven Integration for Eclipse
#Wed Jan 20 18:37:06 KST 2021
#Thu Jan 28 07:55:32 KST 2021
m2e.projectLocation=C\:\\Users\\sjinj\\git\\Blog_Project\\VamPa
m2e.projectName=VamPa
groupId=com.vam

View File

@@ -178,4 +178,20 @@ public class MemberController {
}
/* 메인페이지 로그아웃 */
@RequestMapping(value="logout.do", method=RequestMethod.GET)
public String logoutMainGET(HttpServletRequest request) throws Exception{
logger.info("logoutMainGET메서드 진입");
HttpSession session = request.getSession();
session.invalidate();
return "redirect:/main";
}
}

View File

@@ -37,6 +37,7 @@
<span>회원 : ${member.memberName}</span>
<span>충전금액 : <fmt:formatNumber value="${member.money }" pattern="\#,###.##"/></span>
<span>포인트 : <fmt:formatNumber value="${member.point }" pattern="#,###" /></span>
<a href="/member/logout.do">로그아웃</a>
</div>
</c:if>

View File

@@ -89,6 +89,18 @@
margin: 5% auto;
padding-top: 5%;
}
.login_success_area>a{
font-size: 15px;
font-weight: 900;
display: inline-block;
margin-top: 5px;
background: #e1e5e8;
width: 82px;
height: 22px;
line-height: 22px;
border-radius: 25px;
color: #606267;
}
.login_success_area>span{
display : block;
text-align: left;

View File

@@ -1,5 +1,5 @@
#Generated by Maven Integration for Eclipse
#Wed Jan 20 19:32:05 KST 2021
#Thu Jan 28 08:32:01 KST 2021
m2e.projectLocation=C\:\\Users\\sjinj\\git\\Blog_Project\\VamPa_MySQL
m2e.projectName=VamPa_MySQL
groupId=com.vam