From 700514559732dc5ad07892aea8054b839f554a73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Fri, 11 Mar 2022 09:54:12 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B9=84=EB=B0=80=EB=B2=88=ED=98=B8=20?= =?UTF-8?q?=EC=B0=BE=EA=B8=B0=20=EC=A0=88=EC=B0=A8=20=EB=B3=B4=EC=B6=A9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mca/cmmn/web/CommonController.java | 13 +++++++-- .../sqlmap/mappers/cmmn/UserCertification.xml | 9 +++++- .../webapp/WEB-INF/jsp/anonymous/findPwd.jsp | 28 +++++++++++++------ 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/mca/cmmn/web/CommonController.java b/src/main/java/com/mca/cmmn/web/CommonController.java index 1677d7d..e0b9653 100644 --- a/src/main/java/com/mca/cmmn/web/CommonController.java +++ b/src/main/java/com/mca/cmmn/web/CommonController.java @@ -236,8 +236,15 @@ public class CommonController { //pw찾기 비밀번호 변경 @RequestMapping(value = "passwordUpdate", method = RequestMethod.POST) @ResponseBody - public String passwordUpdate(UserVO userVO){ - userService.updatePwd(userVO); - return "OK"; + public String passwordUpdate(UserCertificationVO certificationVO, UserVO userVO){ + UserCertificationVO savedInfo = userCertificationService.selectCertificationInfo(certificationVO); + if(savedInfo==null){ + return "InfoNull"; + }else if(!savedInfo.getCertification_num().equals(certificationVO.getCertification_num())){ + return "numberNotMatch"; + }else{ + userService.updatePwd(userVO); + return "OK"; + } } } \ No newline at end of file diff --git a/src/main/resources/egovframework/sqlmap/mappers/cmmn/UserCertification.xml b/src/main/resources/egovframework/sqlmap/mappers/cmmn/UserCertification.xml index 742a28b..a063fe4 100644 --- a/src/main/resources/egovframework/sqlmap/mappers/cmmn/UserCertification.xml +++ b/src/main/resources/egovframework/sqlmap/mappers/cmmn/UserCertification.xml @@ -13,7 +13,14 @@ update user_certification diff --git a/src/main/webapp/WEB-INF/jsp/anonymous/findPwd.jsp b/src/main/webapp/WEB-INF/jsp/anonymous/findPwd.jsp index 1747eac..342e24c 100644 --- a/src/main/webapp/WEB-INF/jsp/anonymous/findPwd.jsp +++ b/src/main/webapp/WEB-INF/jsp/anonymous/findPwd.jsp @@ -81,18 +81,18 @@ switch (result){ case "InfoNull": alert("인증번호 발급 정보가 없습니다. 다시 진행해주세요."); - multiModal.close(); + multiModal.hide(); break; case "numberNotMatch": alert("저장된 인증번호와 같지 않습니다."); break; case "isChecked": alert("인증을 마친 번호입니다. 다시 진행해주세요."); - multiModal.close(); + multiModal.hide(); break; case "expirationTimeAfter": alert("인증번호 유효시간이 만료되었습니다. 다시 진행해주세요."); - multiModal.close(); + multiModal.hide(); break; case "OK": alert("인증되었습니다."); @@ -108,6 +108,7 @@ type: "POST", data: { userid: $("#userid").val(), + certification_num: $("#certification_num").val(), password: $("#password").val() }, beforeSend: function (xhr){ @@ -140,12 +141,21 @@ return true; } function passwordUpdateAfter(result){ - debugger - if (result==="OK"){ - alert("변경되었습니다."); - multiModal.close(); - }else{ - alert("변경에 실패하였습니다.") + switch (result) { + case "OK": + alert("변경되었습니다."); + multiModal.hide(); + break; + case "InfoNull": + alert("인증절차가 유효하지 않습니다.\n 다시 진행해주세요."); + multiModal.hide(); + break; + case "numberNotMatch": + alert("인증번호가 맞지 않습니다.\n 다시 진행해주세요."); + multiModal.hide(); + break; + default: + alert("변경에 실패하였습니다."); } }