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("변경에 실패하였습니다."); } }