DB명칭 변경 및 yml에 mybatis설정 추가함.

This commit is contained in:
taesan
2020-02-24 09:48:54 +09:00
parent 6f2afc88a0
commit 11c5ae54b4
6 changed files with 16 additions and 16 deletions

View File

@@ -46,9 +46,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter{
.permitAll()
.and()
.logout()
.permitAll()
.logoutUrl("/logout")
.logoutSuccessUrl("/")
.deleteCookies("JSESSIONID")
.permitAll()
.and()
.exceptionHandling()
.accessDeniedPage("/accessDenied_page"); // 권한이 없는 대상이 접속을시도했을 때

View File

@@ -63,14 +63,10 @@ public class CustomAuthenticationSuccessHandler implements AuthenticationSuccess
String requestUserName = request.getParameter(username);
log.info( " requestUserName : " + requestUserName );
// 실패회수 초기화
accoutDao.resetFailCnt(requestUserName);
// 에러세션 지우기
clearAuthenticationAttributes(request);
// Redirect URL 작업.
resultRedirectStrategy(request, response, authentication);

View File

@@ -17,4 +17,8 @@ server:
servlet:
jsp:
init-parameters:
development: true
development: true
# mybatis 설정.
mybatis:
mapper-locations: classpath:/mybatis/mapper/*.xml

View File

@@ -3,7 +3,7 @@
<mapper namespace="com.boot.test1.mapper.AccountMapper">
<select id="readAccount" parameterType="String" resultType="com.boot.test1.vo.Account">
SELECT * FROM [BSHOP_DATA].dbo.USER_INFO
SELECT * FROM USER_INFO
WHERE ID= #{id}
</select>
@@ -13,7 +13,7 @@
</select>
<insert id="insertUser" parameterType="com.boot.test1.vo.Account">
INSERT [BSHOP_DATA].dbo.USER_INFO
INSERT USER_INFO
VALUES (
#{id},
#{password},
@@ -33,25 +33,25 @@
</insert>
<update id="failCntUpdate" parameterType="String" >
UPDATE [BSHOP_DATA].dbo.USER_INFO
UPDATE USER_INFO
SET failCnt = isnull(failCnt, 0)+1
WHERE ID = #{id}
</update>
<select id="getFailCnt" parameterType="String" resultType="com.boot.test1.vo.Account">
SELECT failCnt, isEnabled FROM [BSHOP_DATA].dbo.USER_INFO
SELECT failCnt, isEnabled FROM USER_INFO
WHERE ID= #{id}
</select>
<update id="changeEnabled" parameterType="String" >
UPDATE [BSHOP_DATA].dbo.USER_INFO
UPDATE USER_INFO
SET isEnabled = (CASE isEnabled WHEN 0 THEN 1 ELSE 0 END) ,
failCnt = (CASE isEnabled WHEN 1 THEN 0 ELSE failCnt END)
WHERE ID = #{id}
</update>
<update id="resetFailCnt" parameterType="String" >
UPDATE [BSHOP_DATA].dbo.USER_INFO
UPDATE USER_INFO
SET failCnt = 0
WHERE ID = #{id}
</update>

View File

@@ -64,8 +64,9 @@
<label> <input type="checkbox"> 아이디 기억하기
</label>
</div>
<sec:authorize access="isAnonymous()">
<button name="submit" type="submit" class="btn btn-block btn-primary text-light">로그인</button>
</sec:authorize>
<%-- <c:if test="${not empty SPRING_SECURITY_LAST_EXCEPTION}"> --%>
<c:if test="${not empty exceptionMsgName}" ><br>
<font color="red">
@@ -84,12 +85,10 @@
<%--<sec:authentication property="principal.username" />님, 겁나 반갑습니다. --%>
</h5>
<br>
<sec:authorize access="isAuthenticated()">
<form action="/logout" method="POST">
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" / >
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
<button type="submit" class="btn btn-dark btn-sm">LOGOUT</button>
</form>
</sec:authorize>
</div>
</sec:authorize>
<input type="hidden" name ="loginRedirect" value="${loginRedirect}" />