Procházet zdrojové kódy

본인인증시 휴대폰 번호 받아 오므로 수정

jsshin před 5 roky
rodič
revize
2d367454ea

+ 16 - 5
src/main/java/com/style24/front/biz/web/TsfCustomerController.java

@@ -542,21 +542,32 @@ public class TsfCustomerController extends TsfBaseController {
 		GagaMap authInfo = niceCertify.getCertifyCellPhoneResultInfo(customer);
 		customer.setCi(authInfo.getString("sCi"));
 		customer.setCellPhnno(authInfo.getString("sMobileNo"));
-		//customer.setCellPhnno("01025906246");
+
 
 		if ("N".equals(authInfo.getString("adult"))) {
 			throw new IllegalStateException("만14세 이상만 회원가입이 가능합니다.");
 		}
 
-		Customer custInfo = customerService.getCustomerFindByCi(customer.getCi());
+		Customer custInfo;
+		custInfo = customerService.getCustomerFindByCi(customer.getCi());	// CI 중복체크
 		if (custInfo != null) {
 			result.setString("maskingCustId", custInfo.getMaskingCustId());
 			result.setBoolean("isFind", true);
-		} else {
-			result.setBoolean("isFind", false);
-			TscSession.setAttribute("encData",customer.getEncData());
+			return result;
+		}
+
+		custInfo = customerService.getCustomerFindByCellPhnno(customer.getCellPhnno());	// 휴대전화 중복체크
+		if (custInfo != null) {
+			result.setString("maskingCustId", custInfo.getMaskingCustId());
+			result.setBoolean("isFind", true);
+			return result;
 		}
 
+		result.setBoolean("isFind", false);
+		result.setString("cellPhnno", customer.getCellPhnno());
+
+		TscSession.setAttribute("encData",customer.getEncData());
+
 		return result;
 	}
 

+ 21 - 23
src/main/webapp/WEB-INF/views/web/customer/JoinFormWeb.html

@@ -133,7 +133,15 @@
 								<p id="failPhnno" class="t_err hide">휴대폰번호를 형식에 맞게 정확히 입력해주세요</p>
 								<!-- //휴대폰번호 형식이 맞지 않을경우 -->
 								<!-- 이미 가입되어있는 핸드폰번호일경우 -->
-								<p id="dupPhnno" class="t_err hide">I***D로 가입된 핸드폰 번호 입니다.</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" onclick="cfnGoToPage(_PAGE_LOGIN);">
+										<span>로그인</span>
+									</button>
+									<button type="button" class="btn btn_default btn_sm" onclick="cfnGoToPage(_PAGE_CUSTOMER_ID_FIND);">
+										<span>아이디 찾기</span>
+									</button>
+								</div>
 								<div class="mt20">
 									<button type="button" id="btnCellPhoneCertify" class="btn btn_default btn_sm">
 										<span>휴대폰 인증</span>
@@ -168,7 +176,6 @@
 	let custIdCheck = false;
 	let passwdCheck = false;
 	let emailCheck = false;
-	let phoneCheck = false;
 	let authCheck = false;
 
 	// 아이디 확인
@@ -364,23 +371,6 @@
 		}
 	});
 
-	// 휴대폰 번호 입력에대한 결과
-	var fnPhoneConfirmCallBack = function (result) {
-		// const $cellPhnno = $('#cellPhnno');
-		const $dupPhnno = $('#dupPhnno');
-		if (result.isFind) { // 가입된 고객 정보가 있으면
-			$dupPhnno.text(result.maskingCustId+'로 가입된 핸드폰 번호 입니다.');
-			$dupPhnno.show();
-			// $cellPhnno.text(result.cellPhnno);
-			// $cellPhnno.show();
-			phoneCheck = false;
-		} else {
-			$dupPhnno.hide();
-			phoneCheck = true;
-		}
-		fnPossibleJoin();
-	};
-	
 
 	//휴대폰 인증
 	$('#btnCellPhoneCertify').on('click', function () {
@@ -399,16 +389,24 @@
 
 	// 본인인증 후 결과
 	var fnInfoConfirmCallBack = function (result) {
-		// const $cellPhnno = $('#cellPhnno');
+		const $cellPhnno = $('#cellPhnno');
 		const $dupPhnno = $('#dupPhnno');
+		const $dupPhnnoDiv = $('#dupPhnnoDiv');
+		const $btnCellPhoneCertify = $('#btnCellPhoneCertify');
+		$cellPhnno.val(result.cellPhnno);
+
 		if (result.isFind) { // 가입된 고객 정보가 있으면
 			$dupPhnno.text(result.maskingCustId+'로 가입된 이력이 있습니다.');
 			$dupPhnno.show();
-			// $cellPhnno.text(result.cellPhnno);
-			// $cellPhnno.show();
+			$dupPhnnoDiv.show();
+			$btnCellPhoneCertify.text('휴대폰 인증');
+			$btnCellPhoneCertify.attr('disabled', false);
 			authCheck = false;
 		} else {
 			$dupPhnno.hide();
+			$dupPhnnoDiv.hide();
+			$btnCellPhoneCertify.text('인증완료');
+			$btnCellPhoneCertify.attr('disabled', true);
 			authCheck = true;
 		}
 		fnPossibleJoin();
@@ -435,7 +433,7 @@
 	// 가입 가능한지 확인
 	var fnPossibleJoin = function () {
 		const $btnJoin = $('#btnJoin');
-		if (custIdCheck && passwdCheck && emailCheck && phoneCheck && authCheck ) {
+		if (custIdCheck && passwdCheck && emailCheck && authCheck ) {
 			$btnJoin.attr('disabled', false);
 		} else {
 			$btnJoin.attr('disabled', true);