Przeglądaj źródła

sns 가입 개발 중

jsshin 5 lat temu
rodzic
commit
d56a589c55

+ 11 - 6
src/main/java/com/style24/front/biz/service/TsfCustomerService.java

@@ -406,7 +406,8 @@ public class TsfCustomerService {
 		}
 
 		if (StringUtils.isBlank(custSnsInfo.getCi())) {
-			throw new IllegalStateException("연계정보 값이 없습니다. 고객센터에 문의하시기 바랍니다.");
+			resultMap.setString("custStat","EMPTY_CI_CUST");
+			return resultMap;
 		}
 
 		// 2. CI(연계정보)로 가입 되어져 있는 고객이 확인
@@ -425,10 +426,6 @@ public class TsfCustomerService {
 			}
 
 			if (TscConstants.CustStat.ACTIVE.value().equals(custInfo.getCustStat())) {
-				if (StringUtils.isBlank(custSnsInfo.getCellPhnno())) { // 휴대폰 정보가 없음 - 회원가입 페이지 이동(ID/PW 제외)
-					resultMap.setString("custStat", "EMPTY_PHONE_CUST");
-					return resultMap;
-				}
 				custInfo.setSnsId(custSnsInfo.getSnsId());
 				custInfo.setSnsType(custSnsInfo.getSnsType());
 				customerDao.createCustomerSns(custInfo);
@@ -526,9 +523,17 @@ public class TsfCustomerService {
 	public GagaMap generalCustomerValidation(Customer customer) {
 		GagaMap resultMap = new GagaMap();
 		String maskingCustId;
+		String custId;
+
+		if (StringUtils.isNotBlank(customer.getSnsType()) && StringUtils.isNotBlank(customer.getSnsId())) {
+			String snsId = customer.getSnsType().equals(TscConstants.SnsType.YES24.value()) ? customer.getMemNo() : customer.getSnsId();
+			custId = customer.getSnsType() + "_" + snsId;
+		} else {
+			custId = customer.getCustId();
+		}
 
 		// 1. 아이디 확인
-		boolean boolCustId = getCustomerFindByCustIdCount(customer.getCustId());
+		boolean boolCustId = getCustomerFindByCustIdCount(custId);
 		if (boolCustId) {
 			maskingCustId = getMaxCustIdById(customer.getCustId());
 			resultMap.setBoolean("isPossibe", false);

+ 97 - 2
src/main/java/com/style24/front/biz/web/TsfCustomerController.java

@@ -351,7 +351,9 @@ public class TsfCustomerController extends TsfBaseController {
 	 * @since 2021. 02. 05
 	 */
 	@RequestMapping("/join/form")
-	public ModelAndView getJoinForm(@RequestParam(value = "sEncData", required = false) String sEncData, @RequestParam(value = "authMethod", required = false) String authMethod, @RequestParam(value = "custParams", required = false) String custParams) {
+	public ModelAndView getJoinForm(@RequestParam(value = "sEncData", required = false) String sEncData
+			, @RequestParam(value = "authMethod", required = false) String authMethod
+			, @RequestParam(value = "custParams", required = false) String custParams) {
 
 		ModelAndView mav = new ModelAndView();
 
@@ -364,6 +366,36 @@ public class TsfCustomerController extends TsfBaseController {
 		return mav;
 	}
 
+	/**
+	 * SNS 가입 시도시 휴대폰 정보 없을시 호출
+	 *
+	 * @return ModelAndView
+	 * @author jsshin
+	 * @since 2021. 06. 08
+	 */
+	@RequestMapping("/sns/join/form")
+	public ModelAndView getSnsJoinForm(@RequestParam(value = "sEncData", required = false) String sEncData
+			, @RequestParam(value = "authMethod", required = false) String authMethod
+			, @RequestParam(value = "custParams", required = false) String custParams, HttpSession session) {
+		ModelAndView mav = new ModelAndView();
+		CustSnsInfo custSnsInfo = (CustSnsInfo)session.getAttribute("custSnsInfo");
+		session.removeAttribute("custSnsInfo"); //세션 지움
+		if (StringUtils.isBlank(custParams)) {
+			if (custSnsInfo == null) {
+				throw new IllegalStateException("연계정보 값이 없습니다. 재로그인 하시기 바랍니다.");
+			}
+		}
+
+		mav.addObject("sEncData", sEncData);
+		mav.addObject("authMethod", authMethod);
+		mav.addObject("custParams", custParams);
+		mav.addObject("custSnsInfo", custSnsInfo);
+
+		mav.setViewName(super.getDeviceViewName("customer/SnsJoinForm"));
+
+		return mav;
+	}
+
 	/**
 	 * 휴대폰 인증 화면
 	 * @param redirectUrl - 모바일사용
@@ -538,6 +570,12 @@ public class TsfCustomerController extends TsfBaseController {
 		GagaMap result = new GagaMap();
 
 		GagaMap authInfo = niceCertify.getCertifyCellPhoneResultInfo(customer);
+		if (StringUtils.isNotBlank(customer.getCi())) {
+			log.info("ci ====> {}, sCi ======> {}", customer.getCi(), authInfo.getString("sCi"));
+			if (!customer.getCi().equals(authInfo.getString("sCi"))) {
+				throw new IllegalStateException("SNS 연계정보와 본인인증 연계정보가 다릅니다.");
+			}
+		}
 		customer.setCi(authInfo.getString("sCi"));
 		customer.setCellPhnno(authInfo.getString("sMobileNo"));
 
@@ -573,7 +611,7 @@ public class TsfCustomerController extends TsfBaseController {
 	}
 
 	/**
-	 * 가입처리
+	 * 일반 가입처리
 	 *
 	 * @param customer - 고객정보
 	 * @param request - 자동로그인
@@ -628,6 +666,63 @@ public class TsfCustomerController extends TsfBaseController {
 		return result;
 	}
 
+	/**
+	 * SNS 회원 가입처리
+	 * 고객 소셜 로그인 후 휴대전화정보가 없을때 해당 로직 사용됨
+	 *
+	 * @param customer - 고객정보
+	 * @param request - 자동로그인
+	 * @param session - 세션 저장된 내용삭제
+	 * @return GagaMap - 결과정보
+	 * @author jsshin
+	 * @since 2021. 02. 18
+	 */
+	@PostMapping("/sns/join/save")
+	@ResponseBody
+	public GagaMap saveSnsJoinCustomer(@RequestBody Customer customer, HttpServletRequest request, HttpSession session) {
+		GagaMap result = new GagaMap();
+
+		// 1.세션에 인코딩된 데이터를 가져온다.
+		String encData = TsfSession.getAttribute("encData");
+		customer.setEncData(encData);
+		session.removeAttribute("encData");
+
+		GagaMap authInfo = niceCertify.getCertifyCellPhoneResultInfo(customer);
+
+		// 2.인증통해 받은 데이터 매핑
+		customer.setSexGb(authInfo.getString("sGender"));
+		customer.setCustNm(authInfo.getString("sName"));
+		customer.setBirthYmd(authInfo.getString("sBirthDate"));
+		customer.setForeignerYn(authInfo.getString("sforeignerYn"));
+		customer.setCi(authInfo.getString("sCi"));
+
+		customer.setSiteCd(TscConstants.Site.STYLE24.value());
+		customer.setFrontGb(TsfSession.getFrontGb());
+		customer.setAfLinkCd(TsfSession.getAttribute("afLinkCd"));
+
+		// 3. 가입 가능여부
+		GagaMap resultMap = customerService.generalCustomerValidation(customer);
+		boolean isPossible = resultMap.getBoolean("isPossibe");
+
+		// 가능하지 않으면 바로 리턴
+		if (!isPossible) {
+			TsfSession.setAttribute("maskingCustId", resultMap.getString("maskingCustId"));
+			result.setBoolean("isJoin", false);
+			return resultMap;
+		}
+
+		// 4.고객정보 생성, SNS 정보 생성 및 혜택 처리
+		boolean isJoin = customerService.saveJoinCustomerSns(customer);
+
+		if (isJoin) {
+			customerService.getLogin(customer.getCustNo(), request);
+		}
+
+		result.setBoolean("isJoin", isJoin);
+
+		return result;
+	}
+
 	/**
 	 * 가입완료 페이지
 	 *

+ 0 - 10
src/main/java/com/style24/front/biz/web/TsfIndexController.java

@@ -278,11 +278,6 @@ public class TsfIndexController extends TsfBaseController {
 			}
 		}
 
-		// RememberMe 값이 있고 true이면
-		if (StringUtils.isNotBlank(TsfSession.getAttribute("rememberMe")) && Boolean.valueOf(TsfSession.getAttribute("rememberMe"))) {
-			userInfo.setBoolean("rememberMe", true);
-		}
-
 		mav.addObject("resultMap", resultMap);
 
 		mav.setViewName(super.getDeviceViewName("SnsCallBackForm"));
@@ -334,11 +329,6 @@ public class TsfIndexController extends TsfBaseController {
 			}
 		}
 
-		// RememberMe 값이 있고 true이면
-		if (StringUtils.isNotBlank(TsfSession.getAttribute("rememberMe")) && Boolean.valueOf(TsfSession.getAttribute("rememberMe"))) {
-			userInfo.setBoolean("rememberMe", true);
-		}
-
 		mav.addObject("resultMap", resultMap);
 		mav.setViewName(super.getDeviceViewName("SnsCallBackForm"));
 

+ 7 - 2
src/main/webapp/WEB-INF/views/mob/SigninFormMob.html

@@ -297,7 +297,7 @@
 		}
 		// 4. 휴대전화 정보가 없으면 SNS 가입화면 이동
 		if (userInfo.custStat === 'EMPTY_PHONE_CUST') {
-			cfnGoToPage(_PAGE_CUSTOMER_JOIN);
+			cfnGoToPage(_PAGE_CUSTOMER_SNS_JOIN);
 		}
 		// 5. YES24 첫 로그인 시도 시 정보동의 페이지 이동
 		if (userInfo.custStat === 'NEED_AGREE_CUST') {
@@ -314,7 +314,12 @@
 			mcxDialog.alert("회원가입에 실패 했습니다.<br> 고객센터에 문의 하시기 바랍니다.");
 			return;
 		}
-		// 8. SNS 로그인 연동 성공 및 기존 SNS 연동된 회원 로그인 시도
+		// 8.SNS 정보로 가입 실패시 안내 창 알림
+		if (userInfo.custStat === 'EMPTY_CI_CUST') {
+			mcxDialog.alert("연계정보(CI) 값이 없습니다.<br> 고객센터에 문의 하시기 바랍니다.");
+			return;
+		}
+		// 9. SNS 로그인 연동 성공 및 기존 SNS 연동된 회원 로그인 시도
 		if (userInfo.custStat === 'SUCC_CUST') {
 			let params = {};
 			params.snsType = userInfo.snsType;

+ 24 - 9
src/main/webapp/WEB-INF/views/mob/SnsCallBackFormMob.html

@@ -26,7 +26,7 @@
 
 	// SNS 로그인 콜백함수(네이버, 카카오, YES24)
 	var fnSnsSigninCallback = function(userInfo) {
-		// 1. CI 정보로 사용자가 없어 회원가입 프로세스 처리 중 이메일, 휴대전화 중복
+		// 1.CI 정보로 사용자가 없어 회원가입 처리 중 이메일, 휴대전화 중복
 		if (userInfo.custStat === 'DUP_PHONE_CUST') {
 			mcxDialog.alert("이미 사용 중인 휴대전화번호 입니다.");
 			return;
@@ -35,12 +35,12 @@
 			mcxDialog.alert("이미 사용 중인 이메일 입니다.");
 			return;
 		}
-		// 2. SNS 로그인 정보로 탈퇴확인
+		// 2.SNS 로그인 정보로 탈퇴확인
 		if (userInfo.custStat === 'SECEDE_CUST') {
 			mcxDialog.alert("탈퇴 회원 입니다.");
 			return;
 		}
-		// 3. SNS 로그인 정보로 휴면확인
+		// 3.SNS 로그인 정보로 휴면확인
 		if (userInfo.custStat === 'DORMANT_CUST') {
 			mcxDialog.alertC("휴면 고객님께서는 휴면을<br>해지하신 후 사용하실 수 있습니다.", {
 				sureBtnText: "확인",
@@ -50,26 +50,41 @@
 			});
 			return;
 		}
-		// 4. 휴대전화 정보가 없으면 SNS 가입화면 이동
+		// 4.휴대전화 정보가 없으면 SNS 가입화면 이동
 		if (userInfo.custStat === 'EMPTY_PHONE_CUST') {
-			cfnGoToPage(_PAGE_CUSTOMER_JOIN);
+			cfnGoToPage(_PAGE_CUSTOMER_SNS_JOIN);
 		}
-		// 5. YES24 첫 로그인 시도 시 정보동의 페이지 이동
+		// 5.YES24 첫 로그인 시도 시 정보동의 페이지 이동
 		if (userInfo.custStat === 'NEED_AGREE_CUST') {
 			cfnConsentUseInfo(userInfo.custNm);
 			return;
 		}
-		// 6. SNS 정보로 가입 성공시 가입완료 페이지 이동
+		// 6.SNS 정보로 가입 성공시 가입완료 페이지 이동
 		if (userInfo.custStat === 'NEW_CUST') {
 			cfnGoToPage(_PAGE_CUSTOMER_JOIN_COMPLETE);
 			return;
 		}
 		// 7.SNS 정보로 가입 실패시 안내 창 알림
 		if (userInfo.custStat === 'FAIL_CUST') {
-			mcxDialog.alert("회원가입에 실패 했습니다.<br> 고객센터에 문의 하시기 바랍니다.");
+			mcxDialog.alertC("회원가입에 실패 했습니다.<br> 고객센터에 문의 하시기 바랍니다.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					cfnGoToPage(_PAGE_CUSTOMER_JOIN_TYPE);
+				}
+			});
+			return;
+		}
+		// 8.CI 정보가 없을때 안내 창 알림
+		if (userInfo.custStat === 'EMPTY_CI_CUST') {
+			mcxDialog.alertC("연계정보(CI) 값이 없습니다.<br> 고객센터에 문의 하시기 바랍니다.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					cfnGoToPage(_PAGE_CUSTOMER_JOIN_TYPE);
+				}
+			});
 			return;
 		}
-		// 8. SNS 로그인 연동 성공 및 기존 SNS 연동된 회원 로그인 시도
+		// 9.SNS 로그인 연동 성공 및 기존 SNS 연동된 회원 로그인 시도
 		if (userInfo.custStat === 'SUCC_CUST') {
 			let params = {};
 			params.snsType = userInfo.snsType;

+ 8 - 2
src/main/webapp/WEB-INF/views/mob/customer/ConsentUseInfoFormMob.html

@@ -90,7 +90,7 @@
 		}
 		// 4. 휴대전화 정보가 없으면 SNS 가입화면 이동
 		if (userInfo.custStat === 'EMPTY_PHONE_CUST') {
-			cfnGoToPage(_PAGE_CUSTOMER_JOIN);
+			cfnGoToPage(_PAGE_CUSTOMER_SNS_JOIN);
 			$.modal.close();
 			return;
 		}
@@ -106,7 +106,13 @@
 			$.modal.close();
 			return;
 		}
-		// 7. SNS 로그인 연동 성공 및 기존 SNS 연동된 회원 로그인 시도
+		// 7.CI 정보가 없을때 안내 창 알림
+		if (userInfo.custStat === 'EMPTY_CI_CUST') {
+			mcxDialog.alert("연계정보(CI) 값이 없습니다.<br> 고객센터에 문의 하시기 바랍니다.");
+			$.modal.close();
+			return;
+		}
+		// 8. SNS 로그인 연동 성공 및 기존 SNS 연동된 회원 로그인 시도
 		if (userInfo.custStat === 'SUCC_CUST') {
 			let params = {};
 			params.snsType = userInfo.snsType;

+ 344 - 0
src/main/webapp/WEB-INF/views/mob/customer/SnsJoinFormMob.html

@@ -0,0 +1,344 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org"
+	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
+	layout:decorator="mob/common/layout/LoginLayoutMob">
+<!--
+ *******************************************************************************
+ * @source  : JoinFormMob.html
+ * @desc    : 회원정보 입력 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2021 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.04.16   jsshin     최초 작성
+ *******************************************************************************
+ -->
+<body>
+<th:block layout:fragment="content">
+<style>
+	.hide{display:none}
+</style>
+<main class="container mb">
+	<!-- ★ 컨텐츠 시작 -->
+	<section class="content mb_join_2">
+		<div class="inner">
+			<div class="close">
+				<a href="javascript:void(0);" class="btn_close" onclick="cfnGoToPage(_PAGE_CUSTOMER_JOIN_TYPE);"><span></span><span></span></a>
+			</div>
+		</div>
+		<div class="inner">
+			<h2 class="title">회원정보 입력</h2>
+		</div>
+		<div class="inner">
+			<form id="joinForm" name="joinForm" class="form_wrap form_full" role="form">
+				<div class="form_head">
+					<h2 class="title sr-only">회원정보 입력</h2>
+				</div>
+				<!-- //아이디 사용가능시 -->
+				<!-- 오류시 부모 div에서 제어 -->
+				<div class="form_field">
+					<label class="input_label sr-only">이메일</label>
+					<div class="input_wrap form_full">
+						<input type="text" id="email" name="email" placeholder="이메일" class="form_control" required="required" data-valid-name="이메일" maxlength="30" autocomplete="no" autocapitalize="no"/><!-- 잘못기입된 경우 class "err" 추가 -->
+						<!-- case (이메일 형식이 바르지않을경우,이미 가입되어있는 이메일인경우) -->
+						<div class="help_block">
+							<!-- 이메일 형식이 바르지않을경우 -->
+							<p id="failEmail" class="t_err hide">
+								이메일 형식이 올바르지 않습니다.
+							</p>
+							<!-- //이메일 형식이 바르지않을경우 -->
+							<!-- 이미 가입되어있는 이메일인경우 -->
+							<p id="dupEmail" class="t_err hide">
+								이미 가입된 이메일 주소입니다. 다른 이메일 주소를 입력하여 주세요.
+							</p>
+							<div id="dupEmailDiv" class="mt20 hide">
+								<button type="button" class="btn btn_default btn_sm mini" onclick="cfnGoToPage(_PAGE_LOGIN);">
+									<span>로그인</span>
+								</button>
+								<button type="button" class="btn btn_default btn_sm mini" onclick="cfnGoToPage(_PAGE_CUSTOMER_ID_FIND);">
+									<span>아이디 찾기</span>
+								</button>
+							</div>
+							<!-- //이미 가입되어있는 이메일인경우 -->
+						</div>
+						<!-- //case (이메일 형식이 바르지않을경우,이미 가입되어있는 이메일인경우) -->
+					</div>
+				</div>
+				<!-- 210415_수정 : 휴대폰 인증 수정 -->
+				<div class="form_field">
+					<label class="input_label sr-only">휴대폰번호</label>
+					<!-- 휴대폰 인증 입력 전 -->
+					<div class="input_wrap form_full">
+						<input type="text" id="cellPhnno" name="cellPhnno" placeholder="휴대폰 인증 해주세요." class="form_control" minlength="10" maxlength="11" required="required" data-valid-type="numeric" data-valid-name="휴대폰" readonly="readonly"/>
+						<button type="button" id="btnCellPhoneCertify" class="btn btn_dark btn_hp_certi">
+							<span>본인인증</span>
+						</button>
+					</div>
+					<!-- //휴대폰 인증 입력 전 -->
+
+					<!-- case (휴대폰번호 형식이 맞지 않을경우,이미 가입되어있는 핸드폰번호일경우) -->
+					<div class="help_block">
+						<p id="failPhnno" class="t_err hide">휴대폰번호를 형식에 맞게 정확히 입력해주세요</p>
+						<p id="dupPhnno" class="t_err hide">I***D로 가입된 핸드폰 번호 입니다.</p>
+						<div id="dupPhnnoDiv" class="mt20 hide">
+							<button type="button" class="btn btn_default btn_sm mini" onclick="cfnGoToPage(_PAGE_LOGIN);">
+								<span>로그인</span>
+							</button>
+							<button type="button" class="btn btn_default btn_sm mini" onclick="cfnGoToPage(_PAGE_CUSTOMER_ID_FIND);">
+								<span>아이디 찾기</span>
+							</button>
+						</div>
+					</div>
+				</div>
+				<div class="btn_group_flex">
+					<div>
+						<button type="button" id="btnJoin" class="btn btn_primary btn_block" disabled="disabled">
+							<span>동의하고 가입하기</span>
+						</button>
+					</div>
+				</div>
+				<!-- //210415_수정 : 버튼 형식 변경. -->
+				<div class="desc_wrap t_c mt20">
+					<p>
+						본인은&nbsp;만 14세 이상이며&nbsp;<a href="javascript:void(0)" onclick="cfnUseTermsLayer();">STYLE24이용약관<i class="ico ico_blank ml5"></i></a>,<br>
+						<a href="javascript:void(0)" onclick="cfnPrivacyPolicyLayer('join');">개인정보 수집 및 이용<i class="ico ico_blank ml5"></i></a>,
+						<a href="javascript:void(0)" onclick="cfnPrivacyTrustLayer();">개인정보 취급 위탁<i class="ico ico_blank ml5"></i></a><br>
+						내용을 확인 하였으며,동의합니다.
+					</p>
+				</div>
+				<input type="hidden" name="snsId" value=""/>
+				<input type="hidden" name="snsType" value=""/>
+				<input type="hidden" name="ci" value=""/>
+				<input type="hidden" name="memNo" value=""/>
+			</form>
+		</div>
+	</section>
+	<!-- ★ 컨텐츠 종료 -->
+</main>
+
+<script th:src="@{'/biz/customer.js?v=' + ${#calendars.format(#calendars.createNow(), 'yyyyMMddHHmmss')}}" src="/biz/customer.js"></script>
+<script th:inline="javascript">
+	/*<![CDATA[*/
+	const sEncData = [[${sEncData}]];   //인증 후 해당 페이지로 리다이렉트함
+	const authMethod = [[${authMethod}]]; //인증 후 해당 페이지로 리다이렉트함
+	const custParams = [[${custParams}]];
+	const custSnsInfo = [[${custSnsInfo}]];
+
+	let emailCheck = false;
+	let authCheck = false;
+
+
+	//	이메일 확인
+	$('#email').on('blur', function () {
+		const $failEmail = $('#failEmail');
+		const $dupEmail = $('#dupEmail');
+		const $dupEmailDiv = $('#dupEmailDiv');
+		$failEmail.hide();
+		$dupEmail.hide();
+		$dupEmailDiv.hide();
+
+		let email = $(this).val();
+		let validation;
+
+		if(!gagajf.isNull(email)) {
+			if (!fnCheckValidationEmail(email)) {
+				$failEmail.show();
+				emailCheck = false;
+				validation = false;
+			} else {
+				validation = true;
+				$failEmail.hide();
+			}
+			if (validation) {
+				let custInfo = {};
+				custInfo.email = email;
+				let jsonData = JSON.stringify(custInfo);
+				gagajf.ajaxJsonSubmit('/customer/email/check', jsonData, fnEmailConfirmCallBack);
+			}
+		}
+	});
+
+	// 이메일 확인 결과
+	var fnEmailConfirmCallBack = function (result) {
+		const $dupEmail = $('#dupEmail');
+		const $dupEmailDiv = $('#dupEmailDiv');
+		if (result.isFind) { // 중복된 아이디가 존재
+			$dupEmail.show();
+			$dupEmailDiv.show();
+			emailCheck = false;
+		} else {
+			$dupEmail.hide();
+			$dupEmailDiv.hide();
+			emailCheck = true;
+		}
+		fnPossibleJoin();
+	};
+
+	//휴대폰 인증
+	$('#btnCellPhoneCertify').on('click', function () {
+		let joinForm = $('#joinForm').serializeObject();
+		let custParams = joinForm.email +','+ joinForm.snsId +','+ joinForm.snsType +','+ joinForm.ci +','+ joinForm.memNo;
+		cfnOpenCellphoneCertify(_PAGE_CUSTOMER_SNS_JOIN, custParams);
+	});
+
+	// 나이스 본인인증 후 콜백
+	var fnNiceCallBack = function(encData) {
+		if (!gagajf.isNull(encData)) {
+			let ci = $('#joinForm input[name=ci]').val();
+			let custInfo = {};
+			custInfo.encData = encData;
+			if (!gagajf.isNull(ci)) custInfo.ci = ci;
+			let jsonData = JSON.stringify(custInfo);
+			gagajf.ajaxJsonSubmit('/customer/authentication/check', jsonData, fnInfoConfirmCallBack);
+		}
+	};
+
+	// 본인인증 후 결과
+	var fnInfoConfirmCallBack = function (result) {
+		const $cellPhnno = $('#cellPhnno');
+		const $dupPhnno = $('#dupPhnno');
+		const $dupPhnnoDiv = $('#dupPhnnoDiv');
+		const $btnCellPhoneCertify = $('#btnCellPhoneCertify');
+		$cellPhnno.val(result.cellPhnno);
+
+		if (result.isFind) { // 가입된 고객 정보가 있으면
+			let msg = '';
+			if (result.custStat === 'G104_30') {
+				msg = "탈퇴한 회원입니다. 탈퇴 후 60일 동안 재가입이 불가능합니다.";
+			} else {
+				msg = result.maskingCustId+"로 가입된 이력이 있습니다.";
+			}
+			$dupPhnno.html(msg);
+			$dupPhnno.show();
+			$dupPhnnoDiv.show();
+			authCheck = false;
+		} else {
+			$dupPhnno.hide();
+			$dupPhnnoDiv.hide();
+			authCheck = true;
+		}
+		$btnCellPhoneCertify.find('span').text('인증완료');
+		$btnCellPhoneCertify.attr('disabled', true);
+		fnPossibleJoin();
+	};
+
+	// 저장
+	$('#btnJoin').on('click', function () {
+		mcxDialog.confirm("회원가입을 하시겠습니까?", {
+			cancelBtnText: "취소",
+			sureBtnText: "확인",
+			sureBtnClick: function() {
+				$('#btnJoin').attr('disabled', true);
+				let jsonData = JSON.stringify($('#joinForm').serializeObject());
+				gagajf.ajaxJsonSubmit('/customer/sns/join/save', jsonData, fnJoinSaveCallback);
+			}
+		});
+	});
+
+	var fnJoinSaveCallback = function (result) {
+		cfnGoToPage(_PAGE_CUSTOMER_JOIN_COMPLETE);
+	};
+
+
+	// 가입 가능한지 확인
+	var fnPossibleJoin = function () {
+		const $btnJoin = $('#btnJoin');
+		if (emailCheck && authCheck ) {
+			$btnJoin.attr('disabled', false);
+		} else {
+			$btnJoin.attr('disabled', true);
+		}
+	};
+
+	// 본인인증 후 데이터 입력 값 셋팅
+	var fnDataSet = function (custParams) {
+		const $email = $('#joinForm input[name=email]');
+		const $snsId = $('#joinForm input[name=snsId]');
+		const $snsType = $('#joinForm input[name=snsType]');
+		const $ci = $('#joinForm input[name=ci]');
+		const $memNo = $('#joinForm input[name=memNo]');
+
+		let arrayParams = custParams.split(',');
+		//[0]이메일/[1]SNS_ID/[2]SNS_TYPE/[3]CI/[4]memNo
+		let email = arrayParams[0];
+		let snsId = arrayParams[1];
+		let snsType = arrayParams[2];
+		let ci = arrayParams[3];
+		let memNo = arrayParams[4];
+
+		// console.log(arrayParams);
+		if (!gagajf.isNull(email)) {
+			$email.val(email);
+		}
+		if (!gagajf.isNull(snsId)) {
+			$snsId.val(snsId);
+		}
+		if (!gagajf.isNull(snsType)) {
+			$snsType.val(snsType);
+		}
+		if (!gagajf.isNull(ci)) {
+			$ci.val(ci);
+		}
+		if (!gagajf.isNull(memNo)) {
+			$memNo.val(memNo);
+		}
+		if (!gagajf.isNull(email)) {
+			$email.val(email);
+			$email.trigger('blur');
+		}
+	};
+
+	var fnDataInit = function (custSnsInfo) {
+		const $email = $('#joinForm input[name=email]');
+		const $snsId = $('#joinForm input[name=snsId]');
+		const $snsType = $('#joinForm input[name=snsType]');
+		const $ci = $('#joinForm input[name=ci]');
+		const $memNo = $('#joinForm input[name=memNo]');
+
+		let email = custSnsInfo.email;
+		let snsId = custSnsInfo.snsId;
+		let snsType = custSnsInfo.snsType;
+		let ci = custSnsInfo.ci;
+		let memNo = custSnsInfo.memNo;
+
+		if (!gagajf.isNull(email)) {
+			$email.val(email);
+		}
+		if (!gagajf.isNull(snsId)) {
+			$snsId.val(snsId);
+		}
+		if (!gagajf.isNull(snsType)) {
+			$snsType.val(snsType);
+		}
+		if (!gagajf.isNull(ci)) {
+			$ci.val(ci);
+		}
+		if (!gagajf.isNull(memNo)) {
+			$memNo.val(memNo);
+		}
+		if (!gagajf.isNull(email)) {
+			$email.val(email);
+			$email.trigger('blur');
+		}
+	}
+
+	$(document).ready(function () {
+		if (!gagajf.isNull(custSnsInfo)) {
+			fnDataInit(custSnsInfo);
+		}
+		if (!gagajf.isNull(custParams)) {
+			fnDataSet(custParams);
+		}
+		if (!gagajf.isNull(sEncData)) {
+			fnNiceCallBack(sEncData, authMethod);
+		}
+	});
+
+	/*]]>*/
+</script>
+</th:block>
+</body>
+</html>

+ 13 - 8
src/main/webapp/WEB-INF/views/web/SigninFormWeb.html

@@ -272,7 +272,7 @@
 
 	// SNS 로그인 콜백함수(네이버, 카카오, YES24)
 	var fnSnsSigninCallback = function(userInfo) {
-		// 1. CI 정보로 사용자가 없어 회원가입 프로세스 처리 중 이메일, 휴대전화 중복
+		// 1.CI 정보로 사용자가 없어 회원가입 처리 중 이메일, 휴대전화 중복
 		if (userInfo.custStat === 'DUP_PHONE_CUST') {
 			mcxDialog.alert("이미 사용 중인 휴대전화번호 입니다.");
 			return;
@@ -281,12 +281,12 @@
 			mcxDialog.alert("이미 사용 중인 이메일 입니다.");
 			return;
 		}
-		// 2. SNS 로그인 정보로 탈퇴확인
+		// 2.SNS 로그인 정보로 탈퇴확인
 		if (userInfo.custStat === 'SECEDE_CUST') {
 			mcxDialog.alert("탈퇴 회원 입니다.");
 			return;
 		}
-		// 3. SNS 로그인 정보로 휴면확인
+		// 3.SNS 로그인 정보로 휴면확인
 		if (userInfo.custStat === 'DORMANT_CUST') {
 			mcxDialog.alertC("휴면 고객님께서는 휴면을<br>해지하신 후 사용하실 수 있습니다.", {
 				sureBtnText: "확인",
@@ -296,16 +296,16 @@
 			});
 			return;
 		}
-		// 4. 휴대전화 정보가 없으면 SNS 가입화면 이동
+		// 4.휴대전화 정보가 없으면 SNS 가입화면 이동
 		if (userInfo.custStat === 'EMPTY_PHONE_CUST') {
-			cfnGoToPage(_PAGE_CUSTOMER_JOIN);
+			cfnGoToPage(_PAGE_CUSTOMER_SNS_JOIN);
 		}
-		// 5. YES24 첫 로그인 시도 시 정보동의 페이지 이동
+		// 5.YES24 첫 로그인 시도 시 정보동의 페이지 이동
 		if (userInfo.custStat === 'NEED_AGREE_CUST') {
 			cfnConsentUseInfo(userInfo.custNm);
 			return;
 		}
-		// 6. SNS 정보로 가입 성공시 가입완료 페이지 이동
+		// 6.SNS 정보로 가입 성공시 가입완료 페이지 이동
 		if (userInfo.custStat === 'NEW_CUST') {
 			cfnGoToPage(_PAGE_CUSTOMER_JOIN_COMPLETE);
 			return;
@@ -315,7 +315,12 @@
 			mcxDialog.alert("회원가입에 실패 했습니다.<br> 고객센터에 문의 하시기 바랍니다.");
 			return;
 		}
-		// 8. SNS 로그인 연동 성공 및 기존 SNS 연동된 회원 로그인 시도
+		// 8.CI 정보가 없을때 안내 창 알림
+		if (userInfo.custStat === 'EMPTY_CI_CUST') {
+			mcxDialog.alert("연계정보(CI) 값이 없습니다.<br> 고객센터에 문의 하시기 바랍니다.");
+			return;
+		}
+		// 9.SNS 로그인 연동 성공 및 기존 SNS 연동된 회원 로그인 시도
 		if (userInfo.custStat === 'SUCC_CUST') {
 			let params = {};
 			params.snsType = userInfo.snsType;

+ 8 - 2
src/main/webapp/WEB-INF/views/web/customer/ConsentUseInfoFormWeb.html

@@ -87,7 +87,7 @@
 		}
 		// 4. 휴대전화 정보가 없으면 SNS 가입화면 이동
 		if (userInfo.custStat === 'EMPTY_PHONE_CUST') {
-			cfnGoToPage(_PAGE_CUSTOMER_JOIN);
+			cfnGoToPage(_PAGE_CUSTOMER_SNS_JOIN);
 			$.modal.close();
 			return;
 		}
@@ -103,7 +103,13 @@
 			$.modal.close();
 			return;
 		}
-		// 7. SNS 로그인 연동 성공 및 기존 SNS 연동된 회원 로그인 시도
+		// 7.CI 정보가 없을때 안내 창 알림
+		if (userInfo.custStat === 'EMPTY_CI_CUST') {
+			mcxDialog.alert("연계정보(CI) 값이 없습니다.<br> 고객센터에 문의 하시기 바랍니다.");
+			$.modal.close();
+			return;
+		}
+		// 8. SNS 로그인 연동 성공 및 기존 SNS 연동된 회원 로그인 시도
 		if (userInfo.custStat === 'SUCC_CUST') {
 			let params = {};
 			params.snsType = userInfo.snsType;

+ 13 - 8
src/main/webapp/WEB-INF/views/web/customer/JoinTypeFormWeb.html

@@ -69,7 +69,7 @@
 
 	// SNS 로그인 콜백함수(네이버, 카카오, YES24)
 	var fnSnsSigninCallback = function(userInfo) {
-		// 1. CI 정보로 사용자가 없어 회원가입 프로세스 처리 중 이메일, 휴대전화 중복
+		// 1.CI 정보로 사용자가 없어 회원가입 처리 중 이메일, 휴대전화 중복
 		if (userInfo.custStat === 'DUP_PHONE_CUST') {
 			mcxDialog.alert("이미 사용 중인 휴대전화번호 입니다.");
 			return;
@@ -78,12 +78,12 @@
 			mcxDialog.alert("이미 사용 중인 이메일 입니다.");
 			return;
 		}
-		// 2. SNS 로그인 정보로 탈퇴확인
+		// 2.SNS 로그인 정보로 탈퇴확인
 		if (userInfo.custStat === 'SECEDE_CUST') {
 			mcxDialog.alert("탈퇴 회원 입니다.");
 			return;
 		}
-		// 3. SNS 로그인 정보로 휴면확인
+		// 3.SNS 로그인 정보로 휴면확인
 		if (userInfo.custStat === 'DORMANT_CUST') {
 			mcxDialog.alertC("휴면 고객님께서는 휴면을<br>해지하신 후 사용하실 수 있습니다.", {
 				sureBtnText: "확인",
@@ -93,16 +93,16 @@
 			});
 			return;
 		}
-		// 4. 휴대전화 정보가 없으면 SNS 가입화면 이동
+		// 4.휴대전화 정보가 없으면 SNS 가입화면 이동
 		if (userInfo.custStat === 'EMPTY_PHONE_CUST') {
-			cfnGoToPage(_PAGE_CUSTOMER_JOIN);
+			cfnGoToPage(_PAGE_CUSTOMER_SNS_JOIN);
 		}
-		// 5. YES24 첫 로그인 시도 시 정보동의 페이지 이동
+		// 5.YES24 첫 로그인 시도 시 정보동의 페이지 이동
 		if (userInfo.custStat === 'NEED_AGREE_CUST') {
 			cfnConsentUseInfo(userInfo.custNm);
 			return;
 		}
-		// 6. SNS 정보로 가입 성공시 가입완료 페이지 이동
+		// 6.SNS 정보로 가입 성공시 가입완료 페이지 이동
 		if (userInfo.custStat === 'NEW_CUST') {
 			cfnGoToPage(_PAGE_CUSTOMER_JOIN_COMPLETE);
 			return;
@@ -112,7 +112,12 @@
 			mcxDialog.alert("회원가입에 실패 했습니다.<br> 고객센터에 문의 하시기 바랍니다.");
 			return;
 		}
-		// 8. SNS 로그인 연동 성공 및 기존 SNS 연동된 회원 로그인 시도
+		// 8.CI 정보가 없을때 안내 창 알림
+		if (userInfo.custStat === 'EMPTY_CI_CUST') {
+			mcxDialog.alert("연계정보(CI) 값이 없습니다.<br> 고객센터에 문의 하시기 바랍니다.");
+			return;
+		}
+		// 9.SNS 로그인 연동 성공 및 기존 SNS 연동된 회원 로그인 시도
 		if (userInfo.custStat === 'SUCC_CUST') {
 			let params = {};
 			params.snsType = userInfo.snsType;

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

@@ -169,7 +169,7 @@ var cfnOpenCellphoneCertify = function (redirectUrl, custParams) {
 		if (!gagajf.isNull(redirectUrl)) {
 			actionUrl = actionUrl + "?redirectUrl=" + redirectUrl;
 			if (!gagajf.isNull(custParams)) {
-				actionUrl = actionUrl + "&custParams=" + custParams;
+				actionUrl = actionUrl + "&custParams=" + encodeURIComponent(custParams);
 			}
 			document.location.href = actionUrl;
 		}
@@ -426,9 +426,9 @@ var cfnLoginKakao = function (requestGb, chkRememberMe) {
 	let popupX = (window.screen.width / 2) - (popupWidth / 2);
 	let popupY = (window.screen.height / 3) - (popupHeight / 3);
 	if ('P' === _frontGb) {
-		//window.open(actionUrl, 'kakaoLogin', 'top=' + popupY + ',left=' + popupX + ',height=' + popupHeight + ',width=' + popupWidth + ', fullscreen=no,menubar=no,status=no,toolbar=no,titlebar=yes,location=no,scrollbars=yes', '');
+		// window.open(actionUrl, 'kakaoLogin', 'top=' + popupY + ',left=' + popupX + ',height=' + popupHeight + ',width=' + popupWidth + ', fullscreen=no,menubar=no,status=no,toolbar=no,titlebar=yes,location=no,scrollbars=yes', '');
 	} else {
-		//document.location.href = actionUrl + '&requestGb=' + requestGb;
+		// document.location.href = actionUrl + '&requestGb=' + requestGb;
 	}
 };