Merge branch 'tolag3'
This commit is contained in:
commit
c223bf62bf
@ -255,7 +255,7 @@ public class AdjReqMgrVO extends ComDefaultVO implements Serializable{
|
||||
private String phone; // 수신번호
|
||||
private String userId;
|
||||
private String smsSendTypeCd; // 발송유형 - CC052
|
||||
private String certNum;
|
||||
private String certNum; // 인증번호
|
||||
|
||||
public AdjReqMgrVO getAdrVO() {
|
||||
return adrVO;
|
||||
|
||||
@ -41,4 +41,6 @@ public interface SMSOracleService {
|
||||
|
||||
// SMS OTP 인증번호 발송(저작위 SMS서버 DB등록)
|
||||
public String insertSmsOtpCertNumSend(AdjReqMgrVO adjReqMgrVO) throws Exception;
|
||||
|
||||
public String selectAdrOtpCertNumSmsLog(AdjReqMgrVO adjReqMgrVO) throws Exception;
|
||||
}
|
||||
|
||||
@ -730,8 +730,11 @@ public class SMSOracleServiceImpl extends EgovAbstractServiceImpl implements SM
|
||||
LOGGER.debug("SMS 전송DB 등록 결과:[" + result +"]");
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String selectAdrOtpCertNumSmsLog(AdjReqMgrVO adjReqMgrVO) throws Exception{
|
||||
|
||||
return msgMgrDAO.selectAdrOtpCertNumSmsLog(adjReqMgrVO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,12 +1,22 @@
|
||||
package kcc.kccadr.kccadrCom.web;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import kcc.com.cmm.LoginVO;
|
||||
import kcc.kccadr.adjreqmgr.service.AdjReqMgrVO;
|
||||
import kcc.kccadr.cmm.service.SMSOracleService;
|
||||
|
||||
@Component("OtpCertUtil")
|
||||
public class OtpCertUtil {
|
||||
|
||||
@Resource(name = "SMSOracleService")
|
||||
private SMSOracleService sMSOracleService;
|
||||
|
||||
/**
|
||||
* @Method Name : otpCert
|
||||
@ -32,41 +42,32 @@ public class OtpCertUtil {
|
||||
adjReqMgrVO.setCertNum(loginVO_P.getCertNum());
|
||||
adjReqMgrVO.setPhone(loginVO_P.getPhone());
|
||||
adjReqMgrVO.setFrstRegisterId(loginVO_R.getUniqId());
|
||||
adjReqMgrVO.setSmsSendTypeCd("001");
|
||||
|
||||
String frstRegistPnttm = "";
|
||||
frstRegistPnttm = sMSOracleService.selectAdrOtpCertNumSmsLog(adjReqMgrVO);
|
||||
|
||||
|
||||
// // 인증번호 가져오기
|
||||
// sendLogVO = mjonMsgDataService.selectSysMsgLog(sendLogVO);
|
||||
// if (sendLogVO == null) {
|
||||
// return "empty";
|
||||
// } else {
|
||||
// // 시간 비교
|
||||
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
// Date nowdate = new Date();
|
||||
// Date compareDate = format.parse(sendLogVO.getFrstSendPnttm());
|
||||
//
|
||||
// Calendar cal = Calendar.getInstance();
|
||||
// cal.setTime(compareDate);
|
||||
// // 5분 추가
|
||||
// cal.add(Calendar.MINUTE, +5);
|
||||
//
|
||||
// compareDate = cal.getTime();
|
||||
//
|
||||
// // 인증번호을 발송한지 5분 이내일때
|
||||
// if (compareDate.after(nowdate)) {
|
||||
// UserManageVO checkUser = userManageService.selectAdminUserSmsCertCheck(userManageVO);
|
||||
//
|
||||
// if (checkUser != null) {
|
||||
// return "success";
|
||||
// } else {
|
||||
// return "checkNoFail";
|
||||
// }
|
||||
// } else {
|
||||
// return "timeOut";
|
||||
// }
|
||||
// }
|
||||
return "";
|
||||
if ("".equals(frstRegistPnttm) || frstRegistPnttm == null) {
|
||||
return "empty";
|
||||
} else {
|
||||
// 시간 비교
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date nowdate = new Date();
|
||||
Date compareDate = format.parse(frstRegistPnttm);
|
||||
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(nowdate);
|
||||
// 5분 추가
|
||||
cal.add(Calendar.MINUTE, +5);
|
||||
|
||||
nowdate = cal.getTime();
|
||||
|
||||
// 인증번호을 발송한지 5분 이내일때
|
||||
if (compareDate.before(nowdate)) {
|
||||
return "success";
|
||||
} else {
|
||||
return "timeOut";
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
return "exception";
|
||||
|
||||
@ -79,4 +79,10 @@ public class MsgMgrDAO extends EgovAbstractDAO {
|
||||
|
||||
insert("MsgMgrDAO.insertAdrOtpCertNumSmsLog", adjReqMgrVO);
|
||||
}
|
||||
|
||||
public String selectAdrOtpCertNumSmsLog(AdjReqMgrVO adjReqMgrVO) throws Exception{
|
||||
|
||||
return (String) select("MsgMgrDAO.selectAdrOtpCertNumSmsLog", adjReqMgrVO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -207,6 +207,7 @@ public class EgovLoginController {
|
||||
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||
if (isAuthenticated)
|
||||
return "redirect:/cmm/main/mainPage.do";
|
||||
|
||||
// initRsa(request);
|
||||
|
||||
//로그인 페이지 접근시 IP체크 제거_로그인 버튼 클릭 시 로그인 유형에 따라 체크로 변경_221011_이준호
|
||||
@ -560,18 +561,12 @@ public class EgovLoginController {
|
||||
|
||||
if(StringUtil.isNotEmpty(loginVO.getCertNum()) && "002".equals(resultVO.getLoginTypeCd())) {
|
||||
|
||||
//수신자
|
||||
// String callTo = resultVO.getMoblphonNo();
|
||||
// String checkNo = loginVO.getCheckNo();
|
||||
// String mberId = resultVO.getId();
|
||||
|
||||
/*
|
||||
* 인증번호 비교
|
||||
* return
|
||||
* empty = "인증번호 발송 내역이 없습니다. 최고관리자에게 문의하세요."
|
||||
* success = "5분이내 발송 내역 비교, 인증번호 비교 시 일치"
|
||||
* smsCertFlag = true
|
||||
* checkNoFail = "인증번호를 확인해 주세요"
|
||||
* smsCertFlag = true
|
||||
* timeOut = "인증번호 시간이 초과되었습니다. \\n 인증번호를 다시 발송합니다."
|
||||
* Exception = "에러가 발생하였습니다. 다시 시도해 주세요. \\n 에러가 지속될 시 최고관리자에게 문의하세요.";
|
||||
* final = "exception";
|
||||
@ -582,51 +577,29 @@ public class EgovLoginController {
|
||||
* */
|
||||
String result = otpCertUtil.otpCert(loginVO, resultVO);
|
||||
|
||||
// if(result.equals("empty")) {
|
||||
// loginService.updatePassMissPlus(loginVO);
|
||||
// model.addAttribute("message", "인증번호 발송 내역이 없습니다. 최고관리자에게 문의하세요.");
|
||||
// initRsa(request);
|
||||
// return "uat/uia/EgovLoginUsr";
|
||||
// } else if(result.equals("success")) {
|
||||
// smsCertFlag = true;
|
||||
// } else if(result.equals("checkNoFail")) {
|
||||
// loginService.updatePassMissPlus(loginVO);
|
||||
// model.addAttribute("message", "인증번호를 확인해 주세요");
|
||||
// model.addAttribute("message_auth", "미허용 IP에서 접속하셨습니다. \\n등록 된 휴대폰 번호로 발송된 인증번호를 입력해주세요.");
|
||||
// model.addAttribute("mode", "본인인증");
|
||||
// model.addAttribute("id", resultVO.getId());
|
||||
// model.addAttribute("password", authSelfPw);
|
||||
//
|
||||
// //인증문자 발송
|
||||
// mjonSmsCertSendUtil.mjonSmsCertSend(callTo);
|
||||
//
|
||||
// initRsa(request);
|
||||
// return "uat/uia/EgovLoginUsr";
|
||||
// } else if(result.equals("timeOut")) {
|
||||
// model.addAttribute("message", "인증번호 시간이 초과되었습니다. \\n 인증번호를 다시 발송합니다.");
|
||||
// model.addAttribute("message_auth", "미허용 IP에서 접속하셨습니다. \\n등록 된 휴대폰 번호로 발송된 인증번호를 입력해주세요.");
|
||||
// model.addAttribute("mode", "본인인증");
|
||||
// model.addAttribute("id", resultVO.getId());
|
||||
// model.addAttribute("password", authSelfPw);
|
||||
//
|
||||
// //인증문자 발송
|
||||
// mjonSmsCertSendUtil.mjonSmsCertSend(callTo);
|
||||
//
|
||||
// initRsa(request);
|
||||
// return "uat/uia/EgovLoginUsr";
|
||||
// } else if(result.equals("Exception")) {
|
||||
// model.addAttribute("message", "에러가 발생하였습니다. 다시 시도해 주세요. \\\\n 에러가 지속될 시 최고관리자에게 문의하세요.");
|
||||
// model.addAttribute("message_auth", "미허용 IP에서 접속하셨습니다. \\n등록 된 휴대폰 번호로 발송된 인증번호를 입력해주세요.");
|
||||
// model.addAttribute("mode", "본인인증");
|
||||
// model.addAttribute("id", resultVO.getId());
|
||||
// model.addAttribute("password", authSelfPw);
|
||||
//
|
||||
// //인증문자 발송
|
||||
// mjonSmsCertSendUtil.mjonSmsCertSend(callTo);
|
||||
//
|
||||
// initRsa(request);
|
||||
// return "uat/uia/EgovLoginUsr";
|
||||
// }
|
||||
if(result.equals("empty")) {
|
||||
loginService.updatePassMissPlus(loginVO);
|
||||
model.addAttribute("message", "인증번호가 일치하지 않습니다. \\n 다시 시도해주세요.");
|
||||
return "uat/uia/EgovLoginUsr";
|
||||
} else if(result.equals("success")) {
|
||||
otpCertFlag = true;
|
||||
} else if(result.equals("timeOut")) {
|
||||
model.addAttribute("message", "인증번호 시간이 초과되었습니다.");
|
||||
model.addAttribute("message_auth", "미허용 IP에서 접속하셨습니다. \\n 인증번호 받기를 다시 시도해주세요.");
|
||||
model.addAttribute("mode", "OTP");
|
||||
model.addAttribute("id", resultVO.getId());
|
||||
model.addAttribute("password", authSelfPw);
|
||||
|
||||
return "uat/uia/EgovLoginUsr";
|
||||
} else if(result.equals("Exception")) {
|
||||
model.addAttribute("message", "에러가 발생하였습니다. 다시 시도해 주세요. \\\\n 에러가 지속될 시 최고관리자에게 문의하세요.");
|
||||
model.addAttribute("message_auth", "미허용 IP에서 접속하셨습니다. \\n 인증번호 받기를 다시 시도해주세요.");
|
||||
model.addAttribute("mode", "OTP");
|
||||
model.addAttribute("id", resultVO.getId());
|
||||
model.addAttribute("password", authSelfPw);
|
||||
|
||||
return "uat/uia/EgovLoginUsr";
|
||||
}
|
||||
}
|
||||
|
||||
if (loginService.getUserAuth(resultVO) != null) {
|
||||
@ -653,13 +626,6 @@ public class EgovLoginController {
|
||||
|
||||
HttpServletRequest req = ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest();
|
||||
String userIp = EgovClntInfo.getClntIP(req);
|
||||
// String userIp = req.getHeader("X-FORWARDED-FOR");
|
||||
// if (userIp == null) {
|
||||
// userIp = req.getRemoteAddr();
|
||||
// }
|
||||
|
||||
// 개발중 IP 유형 테스트
|
||||
// userIp = "123.456.789.000";
|
||||
|
||||
/*
|
||||
* 관리자 로그인 유형 추가_221011
|
||||
@ -698,7 +664,7 @@ public class EgovLoginController {
|
||||
|
||||
}
|
||||
// OTP 로그인
|
||||
else if("002".equals(resultVO.getLoginTypeCd()) && StringUtil.isEmpty(resultVO.getCertNum())){
|
||||
else if("002".equals(resultVO.getLoginTypeCd()) && StringUtil.isEmpty(loginVO.getCertNum()) && !otpCertFlag){
|
||||
|
||||
model.addAttribute("mode","OTP");
|
||||
|
||||
|
||||
@ -225,34 +225,41 @@
|
||||
</insert>
|
||||
|
||||
<insert id="MsgMgrDAO.insertAdrOtpCertNumSmsLog" parameterClass="AdjReqMgrVO">
|
||||
|
||||
INSERT
|
||||
INTO adr_sms_send_mgr
|
||||
(
|
||||
sms_send_seq,
|
||||
sms_send_type_cd,
|
||||
phone,
|
||||
call_from,
|
||||
cn,
|
||||
cert_num,
|
||||
frst_regist_pnttm,
|
||||
frst_register_id
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#smsSendSeq#,
|
||||
#smsSendTypeCd#,
|
||||
#trPhone#,
|
||||
#sendTelNo#,
|
||||
#sendMsg#,
|
||||
#certNum#,
|
||||
now(),
|
||||
#frstRegisterId#
|
||||
)
|
||||
|
||||
|
||||
(
|
||||
sms_send_seq,
|
||||
sms_send_type_cd,
|
||||
phone,
|
||||
call_from,
|
||||
cn,
|
||||
cert_num,
|
||||
frst_regist_pnttm,
|
||||
frst_register_id
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
#smsSendSeq#,
|
||||
#smsSendTypeCd#,
|
||||
#trPhone#,
|
||||
#sendTelNo#,
|
||||
#sendMsg#,
|
||||
#certNum#,
|
||||
now(),
|
||||
#frstRegisterId#
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="MsgMgrDAO.selectAdrOtpCertNumSmsLog" parameterClass="AdjReqMgrVO" resultClass="String">
|
||||
|
||||
SELECT a.frst_regist_pnttm AS frstRegistPnttm
|
||||
FROM adr_sms_send_mgr a
|
||||
WHERE a.phone = #phone#
|
||||
AND a.frst_register_id = #frstRegisterId#
|
||||
AND a.sms_send_type_cd = '001'
|
||||
AND a.cert_num = #certNum#
|
||||
ORDER BY frst_regist_pnttm DESC LIMIT 1
|
||||
|
||||
</select>
|
||||
|
||||
</sqlMap>
|
||||
@ -79,7 +79,7 @@ function actionLogin() {
|
||||
return false;
|
||||
}
|
||||
<c:if test="${mode == 'OTP'}">
|
||||
else if (document.loginForm.checkNo.value ==""){
|
||||
else if (document.loginForm.certNum.value ==""){
|
||||
alert("인증번호를 입력하세요.");
|
||||
return false;
|
||||
}
|
||||
@ -96,7 +96,7 @@ function actionLogin() {
|
||||
$("#id").val(id);
|
||||
$("#password").val(pw);
|
||||
$("#password2").val(pw);
|
||||
|
||||
|
||||
document.loginForm.action="<c:url value='/uat/uia/actionSecurityLogin.do'/>";
|
||||
saveid(document.loginForm);
|
||||
document.loginForm.submit();
|
||||
@ -169,6 +169,7 @@ function optCertNumSms(){
|
||||
success: function (returnData, status) {
|
||||
console.log(returnData.result);
|
||||
if(returnData.result == 'SUCCESS'){
|
||||
alert("인증번호가 발송되었습니다. \n 발송된 인증번호를 입력해주세요.");
|
||||
}else{
|
||||
alert(returnData.message);
|
||||
}
|
||||
@ -176,6 +177,10 @@ function optCertNumSms(){
|
||||
error: function (e) { alert("요청에 실패하였습니다."); console.log("ERROR : ", e); }
|
||||
});
|
||||
}
|
||||
|
||||
function onlyNumber(thisObj) {
|
||||
thisObj.value = thisObj.value.replace(/[^0-9]/gi, "");
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
@ -196,19 +201,21 @@ function optCertNumSms(){
|
||||
</div>
|
||||
<div class="login_right_box login_right_otp_box">
|
||||
<p class="login_tit">로그인</p>
|
||||
<kc:profile value="local">
|
||||
아이디 선택 : <select id="devIdSelect" style="width: 400px; height: 30px;" onchange="login()">
|
||||
<option value="">로그인할 아이디를 선택해주세요.</option>
|
||||
<option value="admin">관리자1 </option>
|
||||
<option value="admin1">관리자2 </option>
|
||||
|
||||
<option value="adradmin1">저작권위원회 관리자1(기본담당자)</option>
|
||||
<option value="adradmin2">저작권위원회 관리자2(팀장)</option>
|
||||
<option value="adradmin3">저작권위원회 관리자3(부서장)</option>
|
||||
<option value="adradmin4">저작권위원회 관리자4(위원장)</option>
|
||||
</select>
|
||||
<br></br>
|
||||
</kc:profile>
|
||||
<c:if test="${mode ne 'OTP'}">
|
||||
<kc:profile value="local">
|
||||
아이디 선택 : <select id="devIdSelect" style="width: 400px; height: 30px;" onchange="login()">
|
||||
<option value="">로그인할 아이디를 선택해주세요.</option>
|
||||
<option value="admin">관리자1 </option>
|
||||
<option value="admin1">관리자2 </option>
|
||||
|
||||
<option value="adradmin1">저작권위원회 관리자1(기본담당자)</option>
|
||||
<option value="adradmin2">저작권위원회 관리자2(팀장)</option>
|
||||
<option value="adradmin3">저작권위원회 관리자3(부서장)</option>
|
||||
<option value="adradmin4">저작권위원회 관리자4(위원장)</option>
|
||||
</select>
|
||||
<br></br>
|
||||
</kc:profile>
|
||||
</c:if>
|
||||
<div class="id_box">
|
||||
<p>ID</p>
|
||||
<label for="id_text"></label>
|
||||
@ -223,7 +230,7 @@ function optCertNumSms(){
|
||||
<div class="id_box otp_phone_box">
|
||||
<p>휴대폰번호</p>
|
||||
<label for="phone"></label>
|
||||
<input type="text" name="phone" id="phone" placeholder="휴대폰번호를 입력해주세요." />
|
||||
<input type="text" name="phone" id="phone" onkeyup="onlyNumber(this)" placeholder="휴대폰번호를 입력해주세요." />
|
||||
<button type="button" class="otp_phone_btn" onclick="optCertNumSms();">인증번호받기</button>
|
||||
</div>
|
||||
<div class="id_box otp_phone_box">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user