Procházet zdrojové kódy

Merge branch 'jsshin' into develop

jsshin před 5 roky
rodič
revize
18b57919ae

+ 10 - 4
src/main/java/com/style24/front/biz/thirdparty/Yes24Login.java

@@ -1,5 +1,6 @@
 package com.style24.front.biz.thirdparty;
 
+import com.gagaframework.web.parameter.GagaMap;
 import com.gagaframework.web.util.GagaFileUtil;
 import com.style24.front.support.security.session.TsfSession;
 import lombok.extern.slf4j.Slf4j;
@@ -35,16 +36,21 @@ public class Yes24Login {
 	 * @since 2021. 03. 03
 	 */
 	public String getAuthorizeUrl(String state) {
-		String authorizeUrl = "https://www.yes24.com/Templates/FTLogin.aspx";
-		String authorizeUrl2 = "https://www.yes24.com/Templates/FTLoginPartner.aspx";
-		String callBackUrl = "/signin/snsLoginCallback?snsType=YS";
+		String authorizeUrl = "https://www.yes24.com/Templates/FTLoginPartner.aspx";
+		String callBackUrl = "/signin/yes24LoginCallback";
 		StringBuilder apiUrlBuilder = new StringBuilder();
 		String redirectUri = GagaFileUtil.getConcatenationPath(PROTOCOL + TsfSession.getHttpServletRequest().getServerName(), callBackUrl);
-		apiUrlBuilder.append(authorizeUrl2)
+		apiUrlBuilder.append(authorizeUrl)
 				.append("?PID=101582")
 				.append("&ReturnURL=")
 				.append(redirectUri);
 		log.info("apiUrlBuilder ===> {}", apiUrlBuilder.toString());
 		return apiUrlBuilder.toString();
 	}
+
+	public GagaMap getAccessInfo(String ci) {
+		GagaMap result = new GagaMap();
+
+		return result;
+	}
 }

+ 45 - 2
src/main/java/com/style24/front/biz/web/TsfIndexController.java

@@ -130,7 +130,6 @@ public class TsfIndexController extends TsfBaseController {
 	 * 로그인 페이지
 	 * @param error - 로그인 오류 정보
 	 * @param session - HttpSession
-	 * @param snsType - SNS유형(NV:네이버, KK:카카오, FB:페이스북)
 	 * @return
 	 * @author gagamel
 	 * @throws IOException
@@ -296,10 +295,12 @@ public class TsfIndexController extends TsfBaseController {
 		if (isSnsLoing) {
 			CustSnsInfo custSnsInfo = objectMapper.convertValue(userInfo, CustSnsInfo.class);
 			log.info("custSnsInfo ==> {}", custSnsInfo.toString());
-			//상태 체크
+
+			//SNS 로그인 처리
 			resultMap = customerService.customerSnsProcessing(custSnsInfo);
 			resultMap.setString("snsId", custSnsInfo.getSnsId());
 			resultMap.setString("snsType", custSnsInfo.getSnsType());
+
 			String custStat = resultMap.getString("custStat");
 
 			// 신규가입 이면 바로 로그인 처리
@@ -325,4 +326,46 @@ public class TsfIndexController extends TsfBaseController {
 		return mav;
 	}
 
+
+	@RequestMapping("/signin/yes24LoginCallback")
+	public ModelAndView yes24LoginCallback(@RequestParam("ipin")String ipin, HttpSession session, HttpServletRequest request) {
+		ModelAndView mav = new ModelAndView();
+		boolean isSnsLoing = false;
+		GagaMap userInfo = new GagaMap();
+
+		if (StringUtils.isNotBlank(ipin)) {
+			log.info(ipin);
+		}
+
+
+		GagaMap resultMap = new GagaMap();
+
+		// SNS 로그인 성공시 정보 세션 저장
+		if (isSnsLoing) {
+			CustSnsInfo custSnsInfo = objectMapper.convertValue(userInfo, CustSnsInfo.class);
+			log.info("custSnsInfo ==> {}", custSnsInfo.toString());
+
+			//SNS 로그인 처리
+			resultMap = customerService.customerSnsProcessing(custSnsInfo);
+			resultMap.setString("snsId", custSnsInfo.getSnsId());
+			resultMap.setString("snsType", custSnsInfo.getSnsType());
+
+			String custStat = resultMap.getString("custStat");
+
+			// 신규가입 이면 바로 로그인 처리
+			if ("NEW_CUST".equals(custStat)) {
+				customerService.getLogin(Integer.parseInt(resultMap.getString("custNo")), request);
+			}
+
+			// 가입 폼으로 이동
+			if ("EMPTY_PHONE_CUST".equals(custStat)) {
+				session.setAttribute("custSnsInfo", custSnsInfo);
+			}
+		}
+		mav.addObject("resultMap", resultMap);
+		mav.setViewName(super.getDeviceViewName("SnsCallBackForm"));
+
+		return  mav;
+	}
+
 }

+ 7 - 6
src/main/java/com/style24/front/support/security/handler/TsfLoginSuccessHandler.java

@@ -39,12 +39,13 @@ public class TsfLoginSuccessHandler implements AuthenticationSuccessHandler {
 
 	// 로그인 후 메인으로 이동할 페이지 목록
 	private final String[] pagesToMain = new String[] {
-		"/customer/join/form",				// 회원가입
-		"/customer/sns/join/form",			// SNS 회원가입
-		"/customer/id/find/form",			// 아이디찾기
-		"/customer/pwd/find/form",			// 비밀번호찾기
-		"/customer/join/complete/form",		// 회원가입완료
-		"/customer/join/type/form"			// 회원가입유형
+		"/customer/join/form",						// 회원가입
+		"/customer/sns/join/form",					// SNS 회원가입
+		"/customer/id/find/form",					// 아이디찾기
+		"/customer/pwd/find/form",					// 비밀번호찾기
+		"/customer/join/complete/form",				// 회원가입완료
+		"/customer/join/type/form",					// 회원가입유형
+		"/customer/dormant/certify/complete/form"	// 휴면해제
 	};
 
 	@Autowired

+ 22 - 14
src/main/webapp/WEB-INF/views/web/SigninFormWeb.html

@@ -107,7 +107,7 @@
 							</li>
 							<li>
 								<a href="javascript:void(0)">
-									<i class="ico ico_snslogin yes24"></i>
+									<i class="ico ico_snslogin yes24" onclick="cfnLoginYes24();"></i>
 									<span>YES24로 시작하기</span>
 								</a>
 							</li>
@@ -152,6 +152,25 @@
 			, $.param(params)
 			, function(result) {
 				if (result.status != 'OK') {
+
+					if (result.status == 'PWD_5WRONG') {
+						// Do nothing
+					} else if (result.status == 'DORMANT_CUST') {
+						// 휴면회원
+						mcxDialog.alertC("휴면 고객님께서는 휴면을<br>해지하신 후 사용하실 수 있습니다.", {
+							sureBtnText: "확인",
+							sureBtnClick: function() {
+								cfnGoToPage(_PAGE_CUSTOMER_DORMANT);
+							}
+						});
+
+						return;
+					} else if (result.status == 'SECEDE_CUST') {
+						// 탈퇴회원
+					} else if (result.status == 'SESSION_EXPIRED') {
+						// 세션만료
+					}
+
 					if (!gagajf.isNull(result.message)) {
 						let loginFailCnt = Number(result.loginFailInfo.loginFailCnt);
 						
@@ -176,18 +195,7 @@
 							}
 						}
 					}
-					
-					if (result.status == 'PWD_5WRONG') {
-						// Do nothing
-					} else if (result.status == 'DORMANT_CUST') {
-						// 휴면회원
-						//cfnGoToPage(_PAGE_DORMANT_GUIDE);
-					} else if (result.status == 'SECEDE_CUST') {
-						// 탈퇴회원
-					} else if (result.status == 'SESSION_EXPIRED') {
-						// 세션만료
-					}
-					
+
 					return; // 정상적으로 로그인 되지 않았으므로 return
 				}
 				
@@ -292,7 +300,7 @@
 
 
 
-$(document).ready(function() {
+	$(document).ready(function() {
 		$('#loginForm input[name=loginId]').val(gagajf.getCookie(ckLoginId));
 		if (gagajf.isNull($('#loginForm input[name=loginId]').val())) {
 			$('#loginForm input[name=loginId]').focus();

+ 3 - 6
src/main/webapp/WEB-INF/views/web/customer/DormantCertifyCompleteFormWeb.html

@@ -23,13 +23,10 @@
 	<div class="wrap">
 		<div class="content dormant_clear"> <!-- 페이지특정 클래스 = dormant_clear -->
 			<div class="cont_head">
-				<h3>style24</h3>
+				<h4>휴면회원 전환안내</h4>
 			</div>
 			<div class="cont_body">
-				<div class="form_wrap form_col_c">
-					<div class="form_head">
-						<h4>휴면회원 전환안내</h4>
-					</div>
+				<form class="form_wrap form_col_c" role="form">
 					<div class="form_info">
 						<span class="ico_content_dormant2"></span>
 						<p class="c_primary">휴면상태가 해제되었습니다!</p>
@@ -40,7 +37,7 @@
 							<button type="button" class="btn btn_dark btn_block" onclick="cfnGoToPage(_PAGE_LOGIN);"><span>로그인</span></button>
 						</div>
 					</div>
-				</div>
+				</form>
 			</div>
 		</div>
 	</div>

+ 4 - 7
src/main/webapp/WEB-INF/views/web/customer/DormantCertifyFormWeb.html

@@ -23,13 +23,10 @@
 	<div class="wrap">
 		<div class="content dormant"> <!-- 페이지특정 클래스 = dormant -->
 			<div class="cont_head">
-				<h3>style24</h3>
+				<h4>휴면회원 전환안내</h4>
 			</div>
 			<div class="cont_body">
-				<div class="form_wrap form_col_c">
-					<div class="form_head">
-						<h4>휴면회원 전환안내</h4>
-					</div>
+				<form class="form_wrap form_col_c form_full" role="form">
 					<div class="form_info">
 						<span class="ico_content_dormant"></span>
 						<p class="c_primary">최근 1년 이상 서비스를 이용하지 않아 휴면회원으로 전환되었습니다.</p>
@@ -55,7 +52,7 @@
 							정보통신망 이용촉진 및 정보보호 등에 관한 법률 제 29조 (개인정보의 파기) 2항 및 동법 시행령 제 16조에 의거하여 최근 1년 이상 서비스 및 이용 회원의 개인정보를 별도 분리&middot;보관하고 있습니다.
 						</p>
 					</div>
-				</div>
+				</form>
 			</div>
 		</div>
 	</div>
@@ -69,7 +66,7 @@
 			let custInfo = {};
 			custInfo.encData = encData;
 			let jsonData = JSON.stringify(custInfo);
-			gagajf.ajaxJsonSubmit('/customer/dormnat/release', jsonData, fnRelaseCallback);
+			gagajf.ajaxJsonSubmit('/customer/dormant/release', jsonData, fnRelaseCallback);
 		}
 	};
 

+ 2 - 2
src/main/webapp/ux/style24_link.js

@@ -278,8 +278,8 @@ var cfnLoginKakao = function (requestGb, chkRememberMe) {
  */
 var cfnLoginYes24 = function (requestGb, chkRememberMe) {
 	let actionUrl = _frontUrl + '/signin/yes24login?rememberMe=' + chkRememberMe;
-	let popupWidth = 484;
-	let popupHeight = 390;
+	let popupWidth = 987;
+	let popupHeight = 862;
 	let popupX = (window.screen.width / 2) - (popupWidth / 2);
 	let popupY = (window.screen.height / 3) - (popupHeight / 3);
 	if ('P' === _frontGb) {