ソースを参照

모바일 내정보관리 수정 중

jsshin 5 年 前
コミット
3c733ba9f4

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

@@ -786,9 +786,9 @@ public class TsfCustomerService {
 		// 2. 이름, 휴대전화 번호 저장
 		int updateCnt = customerDao.updateCustomerAuth(customer);
 
-		boolean iSsuccess = updateCnt > 0; // 변경 성공시 true
+		boolean isSuccess = updateCnt > 0; // 변경 성공시 true
 
-		result.setBoolean("iSsuccess", iSsuccess);
+		result.setBoolean("isSuccess", isSuccess);
 
 		return result;
 	}

+ 9 - 2
src/main/java/com/style24/front/biz/web/TsfMypageController.java

@@ -5,6 +5,7 @@ import java.util.Collection;
 import java.util.List;
 
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -1744,8 +1745,11 @@ public class TsfMypageController extends TsfBaseController {
 	 * @author jsshin
 	 * @since 2021. 03. 15
 	 */
-	@GetMapping("/customer/modify/form")
-	public ModelAndView getCustomerModifyForm(@RequestParam(required = false) String confirmYn) {
+	@RequestMapping("/customer/modify/form")
+	public ModelAndView getCustomerModifyForm(@RequestParam(required = false) String confirmYn,
+											  @RequestParam(value = "sEncData", required = false) String sEncData ,
+											  @RequestParam(value = "authMethod", required = false) String authMethod) {
+
 		ModelAndView mav = new ModelAndView();
 		String referer = StringUtils.defaultIfBlank(TsfSession.getHttpServletRequest().getHeader("referer"), "");
 		boolean redirect = false;
@@ -1767,6 +1771,9 @@ public class TsfMypageController extends TsfBaseController {
 			return mav;
 		}
 
+		mav.addObject("sEncData", sEncData);
+		mav.addObject("authMethod", authMethod);
+
 		mav.addObject("bankList", rendererService.getCommonCodeList("G942", "Y"));
 
 		mav.setViewName(super.getDeviceViewName("mypage/MypageCustModifyForm"));

+ 36 - 3
src/main/webapp/WEB-INF/views/mob/mypage/MypageCustModifyFormMob.html

@@ -25,7 +25,7 @@
 				<div class="tbl_wrap">
 					<div class="tbl_tit">
 						<h3>회원 정보</h3>
-						<button type="button" id="btnNameCerify" class="btn_popup">
+						<button type="button" id="btnNameCertify" class="btn_popup">
 							<span>개명 본인인증</span>
 						</button>
 					</div>
@@ -212,6 +212,9 @@
 </main>
 <script th:inline="javascript">
 	/*<![CDATA[*/
+	const sEncData = [[${sEncData}]];   //인증 후 해당 페이지로 리다이렉트함
+	const authMethod = [[${authMethod}]]; //인증 후 해당 페이지로 리다이렉트함
+
 	let orgCustInfo;
 	let orgAccountInfo;
 	let accountCheck = false;
@@ -224,8 +227,8 @@
 	// 고객정보 데이터
 	var fnGetCustInfoCallback = function (custInfo) {
 		orgCustInfo = custInfo; // 원본 데이터저장 수정시 비교 작업
-		$('#custModiFyForm td[name=custNm]').text(custInfo.custNm);
-		$('#custModiFyForm td[name=birthYmd]').text(custInfo.birthYmd);
+		$('#custModiFyForm input[name=custNm]').val(custInfo.custNm);
+		$('#custModiFyForm input[name=birthYmd]').val(custInfo.birthYmd);
 		let custId = custInfo.custId;
 		if (custInfo.snsType === 'NV') {
 			custId = '네이버 간편가입회원'
@@ -465,10 +468,40 @@
 			return false;
 		}
 		return true;
+	};
+
+		// 나이스 본인인증 후 콜백
+	var fnNiceCallBack = function(encData) {
+		if (!gagajf.isNull(encData)) {
+			let custInfo = {};
+			custInfo.encData = encData;
+			let jsonData = JSON.stringify(custInfo);
+			gagajf.ajaxJsonSubmit('/mypage/customer/auth/update', jsonData, fnUpdateAuthInfoCallback);
+		}
+	};
+
+	var fnUpdateAuthInfoCallback = function (result) {
+		if (result.isSuccess) {
+			fnGetCustInfo();
+			mcxDialog.alert("본인인증을 통해 정보가 변경 되었습니다.");
+			return;
+		} else {
+			mcxDialog.alert("실패하였습니다.<br/>고객센터에 문의하시 바랍니다.");
+			return;
+		}
 	}
 
+	//개명 본인인증
+	$('#btnNameCertify').on('click', function () {
+		cfnOpenCellphoneCertify(_PAGE_MYPAGE_CUSTOMER_MODIFY+'?confirmYn=Y');
+	});
+
 
 	$(document).ready(function(){
+		if (!gagajf.isNull(sEncData)) {
+			fnNiceCallBack(sEncData, authMethod);
+		}
+
 		$('#htopTitle').text('내 정보 관리');
 
 		// 회원(고객) 조회

+ 1 - 6
src/main/webapp/WEB-INF/views/web/mypage/MypageCustModifyFormWeb.html

@@ -336,7 +336,7 @@
 	};
 
 	var fnUpdateAuthInfoCallback = function (result) {
-		if (result.iSsuccess) {
+		if (result.isSuccess) {
 			fnGetCustInfo();
 			mcxDialog.alert("본인인증을 통해 정보가 변경 되었습니다.");
 			return;
@@ -403,9 +403,6 @@
 			return;
 		}
 
-
-
-
 		// 은행코드가 바꼈는지
 		if (orgAccountInfo.bankCd !== $bankCd.val()) {
 			accountModifyYn = 'Y';
@@ -415,8 +412,6 @@
 			accountModifyYn = 'Y';
 		}
 
-
-
 		if (accountModifyYn === 'Y') { // 환불계좌정보 변경 됐으면
 			if (!gagajf.isNull($bankCd.val()) && !gagajf.isNull($accountNo.val())) {
 				if (!accountCheck) {