فهرست منبع

아이디 찾기 개발 중

jsshin 5 سال پیش
والد
کامیت
6447577a86

+ 6 - 6
pom.xml

@@ -14,12 +14,12 @@
 	
 	<dependencies>
 		<!-- Maven module core -->
-		<dependency>
-			<groupId>com.style24.core</groupId>
-			<artifactId>style24.core</artifactId>
-			<version>0.0.1-SNAPSHOT</version>
-			<scope>compile</scope>
-		</dependency>
+<!--		<dependency>-->
+<!--			<groupId>com.style24.core</groupId>-->
+<!--			<artifactId>style24.core</artifactId>-->
+<!--			<version>0.0.1-SNAPSHOT</version>-->
+<!--			<scope>compile</scope>-->
+<!--		</dependency>-->
 		<!--// Maven module core -->
 		
 		<dependency>

+ 20 - 0
src/main/java/com/style24/front/biz/service/TsfCustomerService.java

@@ -1,5 +1,8 @@
 package com.style24.front.biz.service;
 
+import com.style24.core.biz.service.TscCustomerService;
+import com.style24.core.support.env.TscConstants;
+import com.style24.persistence.domain.Customer;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -20,4 +23,21 @@ public class TsfCustomerService {
 	@Autowired
 	private TsfCustomerDao customerDao;
 
+	@Autowired
+	private TscCustomerService coreCustomerService;
+
+
+	/**
+	 * 고객아이디 찾기
+	 *
+	 * @param customer - 고객정보
+	 * @return Customer
+	 * @author jsshin
+	 * @since 2021. 02. 08
+	 */
+	public Customer getCustomerFindId(Customer customer) {
+		customer.setSiteCd(TscConstants.Site.STYLE24.value());
+		customer.encryptData(); // 데이터 암호하
+		return coreCustomerService.getCustomerInfo(customer);
+	}
 }

+ 47 - 3
src/main/java/com/style24/front/biz/web/TsfCustomerController.java

@@ -1,11 +1,17 @@
 package com.style24.front.biz.web;
 
+import com.gagaframework.web.parameter.GagaMap;
 import com.gagaframework.web.util.GagaStringUtil;
+import com.style24.core.support.env.TscConstants;
+import com.style24.core.support.session.TscSession;
 import com.style24.front.support.security.session.TsfSession;
+import com.style24.persistence.domain.Customer;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 
 import com.style24.core.support.message.TscMessageByLocale;
@@ -14,6 +20,7 @@ import com.style24.front.support.controller.TsfBaseController;
 
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
 /**
@@ -34,21 +41,42 @@ public class TsfCustomerController extends TsfBaseController {
 	private TsfCustomerService customerService;
 
 	/**
-	 * 아이디 & 비밀번호 찾기 화면
+	 * 아이디 찾기 화면
 	 *
 	 * @return ModelAndView
 	 * @author jsshin
 	 * @since 2021. 02. 05
 	 */
 	@RequestMapping("/id/find/form")
-	public ModelAndView idFind() {
+	public ModelAndView idFindForm() {
 		ModelAndView mav = new ModelAndView();
 
-		mav.setViewName(super.getDeviceViewName("customer/FindIdAndPwdForm"));
+		mav.setViewName(super.getDeviceViewName("customer/FindIdForm"));
 
 		return mav;
 	}
 
+	/**
+	 * 아이디 찾기
+	 *
+	 * @return ModelAndView
+	 * @author jsshin
+	 * @since 2021. 02. 08
+	 */
+	@PostMapping("/id/find")
+	@ResponseBody
+	public GagaMap getIdFind(@RequestBody Customer customer) {
+		GagaMap result = new GagaMap();
+		boolean isFind = false;
+		Customer custInfo = customerService.getCustomerFindId(customer);
+		if (custInfo != null) {
+			isFind = true;
+		}
+		result.set("custInfo", custInfo);
+		result.setBoolean("isFind", isFind);
+		return result;
+	}
+
 	/**
 	 * 아이디 찾기 결과 화면
 	 *
@@ -66,6 +94,22 @@ public class TsfCustomerController extends TsfBaseController {
 		return mav;
 	}
 
+	/**
+	 * 비밀번호 찾기 화면
+	 *
+	 * @return ModelAndView
+	 * @author jsshin
+	 * @since 2021. 02. 05
+	 */
+	@RequestMapping("/pwd/find/form")
+	public ModelAndView pwdFindForm() {
+		ModelAndView mav = new ModelAndView();
+
+		mav.setViewName(super.getDeviceViewName("customer/FindPwdForm"));
+
+		return mav;
+	}
+
 
 	/**
 	 * 비밀번호 찾기 결과 화면

+ 319 - 0
src/main/webapp/WEB-INF/views/web/customer/FindIdFormWeb.html

@@ -0,0 +1,319 @@
+<!DOCTYPE html>
+<html lang="ko"
+	xmlns:th="http://www.thymeleaf.org"
+	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
+	layout:decorator="web/common/layout/DefaultLayoutWeb">
+<!--
+ *******************************************************************************
+ * @source  : FindIdFormWeb.html
+ * @desc    : 아이디 비번 찾기 Page
+ *============================================================================
+ * STYLE24
+ * Copyright(C) 2021 TSIT, All rights reserved.
+ *============================================================================
+ * VER  DATE         AUTHOR      DESCRIPTION
+ * ===  ===========  ==========  =============================================
+ * 1.0  2021.02.05   jsshin     최초 작성
+ *******************************************************************************
+ -->
+<body>
+
+<th:block layout:fragment="content">
+<div id="container" class="container mb">
+	<div class="wrap">
+		<div class="content find">
+			<div class="cont_head">
+				<h3>style24</h3>
+			</div>
+			<div class="cont_body">
+				<div class="form_head">
+					<h4>아이디&#47;비밀번호 찾기</h4>
+				</div>
+				<div class="registration_nav">
+					<ul>
+						<li class="active"><a href="javascript:void(0)">아이디 찾기</a></li>
+						<li><a href="javascript:void(0)">비밀번호 찾기</a></li>
+					</ul>
+				</div>
+				<div class="registration_tap">
+					<div class="form_group" style="display: block;">
+						<!-- 아이디찾기일경우 -->
+						<div class="foldGroup checkcase">
+							<ul>
+								<li>
+									<form id="searchCustInfo" name="searchCustInfo" class="form_wrap" method="post">
+										<div class="fold_head">
+											<a href="javascript:void(0)">
+												<div>
+													<div class="fold_tit">
+														<span>회원정보로 찾기</span>
+													</div>
+												</div>
+											</a>
+										</div>
+										<div class="fold_cont">
+											<div class="txt mb30">
+												<p>등록된 내 회원정보로 찾을 수 있습니다.</p>
+											</div>
+											<div class="form_field">
+												<label class="input_label sr-only">이름</label>
+												<div class="ui_col_12">
+													<div class="input_wrap">
+														<input type="text" name="custNm" placeholder="이름" class="form_control" maxlength="30"/>
+													</div>
+												</div>
+											</div>
+											<div class="form_field">
+												<label class="input_label sr-only">생년월일 8자리 (예:19880912)</label>
+												<div class="ui_col_12">
+													<div class="input_wrap">
+														<input type="text" name="birthYmd" placeholder="생년월일 8자리 (예:19880912)" class="form_control" maxlength="8" data-valid-type="numeric"/>
+													</div>
+												</div>
+											</div>
+											<div class="form_field">
+												<label class="input_label sr-only">이메일</label>
+												<div class="ui_col_12">
+													<div class="input_wrap">
+														<input type="text" name="email" placeholder="이메일" class="form_control" maxlength="30"/>
+													</div>
+												</div>
+											</div>
+											<div class="btn_group_block ui_row mt20">
+												<div class="ui_col_12">
+													<button type="button" id="btnInfoConfirm" class="btn_dark btn_block">
+														확인
+													</button>
+												</div>
+											</div>
+										</div>
+									</form>
+								</li>
+								<li>
+									<form id="certifyPhone" name="certifyPhone" class="form_wrap" role="form">
+										<div class="fold_head">
+											<a href="javascript:void(0)">
+												<div>
+													<div class="fold_tit" style="width: inherit;">
+														<span style="width: inherit;">휴대폰 본인인증으로 찾기</span>
+													</div>
+												</div>
+											</a>
+										</div>
+										<div class="fold_cont">
+											<div class="txt">
+												<p>회원님의 명의로 등록된 휴대폰으로 본인확인을 진행합니다.</p>
+											</div>
+											<div class="ui_row mt20">
+												<div class="ui_col_12">
+													<button type="button" id="btnPhoneConfirm" class=" btn_dark btn_block">
+														<span>본인명의 휴대폰으로 인증</span>
+													</button>
+												</div>
+											</div>
+										</div>
+									</form>
+								</li>
+								<li>
+									<form id="certifyIpin" name="certifyIpin" class="form_wrap" role="form">
+										<div class="fold_head">
+											<a href="javascript:void(0)">
+												<div>
+													<div class="fold_tit" style="width: inherit;">
+														<span style="width: inherit;">아이핀 인증으로 찾기</span>
+													</div>
+												</div>
+											</a>
+										</div>
+										<div class="fold_cont">
+											<div class="txt">
+												<p>아이핀 인증을 통해 찾을 수 있습니다.</p>
+											</div>
+											<div class="ui_row mt20">
+												<div class="ui_col_12">
+													<button type="button" id="btnIpinConfirm" class="btn btn_dark btn_block">
+														<span>아이핀 인증</span>
+													</button>
+												</div>
+											</div>
+										</div>
+									</form>
+								</li>
+							</ul>
+						</div>
+						<!-- //아이디찾기일경우 -->
+						<!-- 아이디찾기 성공일경우 -->
+						<div id="succeedCustId" class="find_result clear" style="display:none;">
+							<div class="form_info">
+								<span class="ico_content_find"></span>
+								<p>아이디 찾기 결과 안내</p>
+							</div>
+							<div class="form_print_bar mt40">
+								<ul>
+									<li>
+										<span class="t_span">아이디</span>
+										<span id="resultId" name="resultId"  class="c_primary bold" data-font="lato"></span>
+									</li>
+									<li>
+										<span class="t_span">가입일자</span>
+										<span id="joinDt" name="joinDt" class="bold" data-font="lato"></span>
+									</li>
+									<li>
+										<span class="t_span">가입경로</span>
+										<span id="joinPath" name="joinPath" class="bold" data-font="lato"></span>
+									</li>
+								</ul>
+							</div>
+							<div class="btn_group_block btn_group_md ui_row">
+								<div class="ui_col_12">
+									<button class="btn btn_dark btn_block">
+										<span>로그인 하기</span>
+									</button>
+								</div>
+							</div>
+						</div>
+						<!-- //아이디찾기 성공일경우 -->
+						<!-- 회원정보로 아이디찾기 실패일경우 -->
+						<div id="failCustId" class="find_result clear" style="display: none;">
+							<div class="form_info">
+								<span class="ico_content_none"></span>
+								<p>입력한 정보와 일치하는 아이디가 존재하지 않습니다.</p>
+								<p class="t_info mt10">
+									정확한 확인을 위해 휴대폰 인증/아이핀 인증을 통한<br>아이디 찾기를 진행해 주세요.
+								</p>
+							</div>
+							<div class="btn_group_block btn_group_md ui_row">
+								<div class="ui_col_6">
+									<button class="btn btn_primary btn_block">
+										<span>회원가입</span>
+									</button>
+								</div>
+								<div class="ui_col_6">
+									<button class="btn btn_dark btn_block">
+										<span>다시 찾기</span>
+									</button>
+								</div>
+							</div>
+						</div>
+						<!-- //회원정보로 아이디찾기 실패일경우 -->
+						<!-- 휴대폰,아이핀 본인인증으로 아이디찾기 실패일경우 -->
+						<div id="failCertification" class="find_result clear" style="display: none;">
+							<div class="form_info">
+								<span class="ico_content_none"></span>
+								<p>입력한 정보와 일치하는 아이디가 존재하지 않습니다.</p>
+								<p class="t_info mt10">
+									<span class="c_primary">STYLE24의 새로운 가족이 되어 주세요!</span>
+								</p>
+							</div>
+							<div class="btn_group_block btn_group_md ui_row">
+								<div class="ui_col_12">
+									<button class="btn btn_primary btn_block">
+										<span>회원가입</span>
+									</button>
+								</div>
+							</div>
+						</div>
+						<!-- //휴대폰,아이핀 본인인증으로 아이디찾기 실패일경우 -->
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+</div>
+
+<script th:inline="javascript">
+/*<![CDATA[*/
+
+	// 회원정보로 아이디 찾기
+	$('#btnInfoConfirm').on('click', function() {
+
+		let custInfo = $('#searchCustInfo').serializeObject();
+
+		if (gagajf.isNull(custInfo.custNm)) {
+			alert('이름을 형식에 맞게 입력해주세요.');
+			return;
+		}
+
+		if (gagajf.isNull(custInfo.email)) {
+			alert('이메일을 입력하여 주세요.');
+			return;
+		}
+
+		if (!fnCheckValidationEmail(custInfo.email)) {
+			alert('이메일 형식에 맞게 입력해주세요.');
+			return;
+		}
+
+		let jsonData = JSON.stringify(custInfo);
+		console.log('jsonData', jsonData);
+		ajaxJsonSubmit('/customer/id/find', jsonData, fnInfoConfirmCallBack);
+	});
+
+
+	// 찾기 결과
+	var fnInfoConfirmCallBack = function (result) {
+		console.log(typeof result.isFind);
+		console.log(result);
+	};
+
+
+	// 이메일 체크
+	var fnCheckValidationEmail = function (email) {
+		const regexp = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/;
+		let result = true;
+		if (!regexp.test(email)) {
+			result = false;
+		}
+		return result;
+	};
+	
+	
+	var ajaxJsonSubmit = function (url, json, callback) {
+		$.ajax({
+			type : "POST",
+			url : url,
+			dataType : 'json',
+			data : json,
+			beforeSend : function(xhr, opts) { // 통신 전
+				// when validation is false
+				// AJAX call
+				xhr.setRequestHeader('AJAX', 'true');
+				// dataType: "json"일 때
+				xhr.setRequestHeader('Accept', 'application/json');
+				xhr.setRequestHeader('Content-Type', 'application/json');
+			},
+			success : function(result) {
+				console.log(result);
+				if (typeof(result.status) == 'undefined' || result.status === 200) { // 성공
+					if (!gagajf.isNull(result.message)) {
+						if (alert(result.message)) {
+							if (typeof(callback) === 'function') {
+								callback.call(this, result);
+							}
+						}
+					} else {
+						if (typeof(callback) == "function") {
+							callback.call(this, result);
+						}
+					}
+				} else { // 실패
+					if (!gagajf.isNull(result.error.message)) {
+						alert(result.error.message);
+					}
+				}
+			},
+			error : function() {
+				// error code
+				alert('오류로 인해 처리되지 않았습니다.');
+			}
+		});
+	}
+
+
+/*]]>*/
+</script>
+
+</th:block>
+
+</body>
+</html>

+ 1 - 1
src/main/webapp/WEB-INF/views/web/customer/FindIdAndPwdFormWeb.html → src/main/webapp/WEB-INF/views/web/customer/FindPwdFormWeb.html

@@ -5,7 +5,7 @@
 	layout:decorator="web/common/layout/DefaultLayoutWeb">
 <!--
  *******************************************************************************
- * @source  : FindIdAndPwdFormWeb.html
+ * @source  : FindIdFormWeb.html
  * @desc    : 아이디 비번 찾기 Page
  *============================================================================
  * STYLE24