2024-11-17 02:45 사용자 로그인시 아이디/비번 인증에 핸드폰 인증 추가

This commit is contained in:
myname 2024-11-17 02:45:52 +09:00
parent 153ae2ad60
commit 51980d12b3
7 changed files with 1243 additions and 7 deletions

View File

@ -94,6 +94,7 @@ public interface MjonMsgDataService {
//시스템 문자발송 로그 조회
public SendLogVO selectSysMsgLog(SendLogVO sendLogVO) throws Exception;
public SendLogVO selectSysMsgLogCheck(SendLogVO sendLogVO) throws Exception;
//주소록 그룹의 저장 주소 리스트 불러오기
public List<AddrVO> selectMsgAddrListAjax(AddrVO addrVO) throws Exception;

View File

@ -202,6 +202,10 @@ public class MjonMsgDataDAO extends EgovAbstractDAO {
return (SendLogVO) select("mjonMsgDAO.selectSysMsgLog",sendLogVO);
}
public SendLogVO selectSysMsgLogCheck(SendLogVO sendLogVO) throws Exception{
return (SendLogVO) select("mjonMsgDAO.selectSysMsgLogCheck",sendLogVO);
}
@SuppressWarnings("unchecked")
public List<AddrVO> selectMsgAddrListAjax(AddrVO addrVO) throws Exception{

View File

@ -2092,6 +2092,11 @@ public class MjonMsgDataServiceImpl extends EgovAbstractServiceImpl implements M
return mjonMsgDataDAO.selectSysMsgLog(sendLogVO);
}
@Override
public SendLogVO selectSysMsgLogCheck(SendLogVO sendLogVO) throws Exception {
return mjonMsgDataDAO.selectSysMsgLogCheck(sendLogVO);
}
public List<AddrVO> selectMsgAddrListAjax(AddrVO addrVO) throws Exception{
return mjonMsgDataDAO.selectMsgAddrListAjax(addrVO);

View File

@ -1463,7 +1463,596 @@ public class EgovLoginController {
* @return result - 로그인결과(세션정보)
* @exception Exception
*/
@RequestMapping(value = "/web/user/login/actionSecurityLogin.do")
@RequestMapping(value = "/web/user/login/actionSecurityLogin_bak_00.do")
public String selectActionSecurityLoginWeb_bak(@ModelAttribute("loginVO") LoginVO loginVO, HttpServletResponse response,
HttpServletRequest request, @RequestParam Map<String, Object> commandMap, ModelMap model,
HttpSession session, RedirectAttributes redirectAttributes) throws Exception {
String userIp = EgovClntInfo.getClntIP(request);
HackIpVO hackIpVO = new HackIpVO();
hackIpVO.setAccessIp(userIp);
hackIpVO.setBlockYn("Y");
if (null != hackIpService.selectHackIpVO(hackIpVO)) {
String message = "차단된 아이피입니다. 관리자에게 문의해 주십시요.";
redirectAttributes.addFlashAttribute("message", message);
return "redirect:/";
}
/*ScriptEngineManager engine = new ScriptEngineManager();*/
loginVO.setUserSe("USR");
// 로그인 정보 check
if (loginVO.getId() == null || loginVO.getPassword() == null) {
// 회원가입 로그인 처리
LoginVO pLoginVO = (LoginVO) request.getAttribute("pLoginVO");
if (pLoginVO == null) {
// RSA 생성
initRsa(request);
/* return "redirect:/web/user/login/login.do"; */
return "redirect:/";
} else {
loginVO.setId(pLoginVO.getId());
loginVO.setPassword(pLoginVO.getPassword());
loginVO.setBeforeUrl(pLoginVO.getBeforeUrl());
loginVO.setMessage(pLoginVO.getMessage());
}
}
// 1. 일반 로그인 처리
PrivateKey privateKey = (PrivateKey) session.getAttribute(EgovLoginController.RSA_WEB_KEY);
if (privateKey == null) {
initRsa(request);
/*return "web/site/login/EgovLoginGnrlUsr";*/
String message = "아이디와 비밀번호를 확인해주세요.";
redirectAttributes.addFlashAttribute("message", message);
System.out.println("======================================================");
System.out.println("= RSA privateKey is null =");
System.out.println("======================================================");
return "redirect:/web/main/mainPage.do";
}
LoginVO resultVO;
// 복호화
String id = "";
try {
//아이디 복호화 소문자 변환
id = decryptRsa(privateKey, loginVO.getId()).toLowerCase();
} catch (Exception e) {
initRsa(request);
// return "redirect:/web/user/login/login.do";
if (loginVO.getBeforeUrl().toString().contains("/web/user/login/login.do")) {
redirectAttributes.addFlashAttribute("fail", true);
return "redirect:/web/user/login/login.do";
}
return "redirect:/";
}
String password = decryptRsa(privateKey, loginVO.getPassword());
loginVO.setId(id);
loginVO.setIp(EgovClntInfo.getClntIP(request));
loginVO.setPassword(password);
loginVO.setUserSe("GNR");
loginVO.setStatusAll("Y"); // 신청대기중인 사용자까지 조회
//기업회원 가입중인지 체크 - 기존 로그인 select는 MBER_STTUS = 'Y' 하드코딩이라 로그인 기업회원 가입중인지 체크
//암호화 2번 방지를 위한 LoginVO 생성
LoginVO loginCmpChkVO = new LoginVO();
loginCmpChkVO.setId(id);
loginCmpChkVO.setIp(EgovClntInfo.getClntIP(request));
loginCmpChkVO.setPassword(password);
loginCmpChkVO.setUserSe("GNR");
loginCmpChkVO.setStatusAll("Y"); // 신청대기중인 사용자까지 조회
loginCmpChkVO.setEmplyrSttusCode("A"); // 신청대기중인 사용자까지 조회
LoginVO cmpHstResultVO = loginService.actionLoginCmpChk(loginCmpChkVO);
if(null != cmpHstResultVO.getId()) {
//기업회원 정보 마지막 내역 조회
MberManageVO mberManageVO = new MberManageVO();
mberManageVO.setMberId(loginVO.getId());
MberManageVO cmpChangeManageVO = mberManageService.selectCmpUsrHst(mberManageVO);
if(null != cmpChangeManageVO) {
if("01".equals(cmpChangeManageVO.getHstType())) { //가장 마지막 내역이 기업회원 가입일
if("01".equals(cmpChangeManageVO.getHstSttus()) || "03".equals(cmpChangeManageVO.getHstSttus()) ) { //가장 마지막 기업회원 가입이 신청 또는 반려 상태일
redirectAttributes.addFlashAttribute("mberId", loginVO.getId());
//addFlashAttribute 일회성으로 인하여 membershipAttachDocBefore.do 이동
//membershipAttachDoc.do로 바로 submit하여 새로고침 정보 유지되게 처리
return "redirect:/web/user/login/membershipAttachDocBefore.do";
}
}
}
}
//스팸처리 회원인지 mj_spam_member_info 해당 ID의 최근 1개 데이터 조회
LoginVO loginSmiChkVO = new LoginVO();
loginSmiChkVO.setId(id);
loginSmiChkVO.setIp(EgovClntInfo.getClntIP(request));
loginSmiChkVO.setPassword(password);
loginSmiChkVO.setUserSe("GNR");
loginSmiChkVO.setStatusAll("Y"); // 신청대기중인 사용자까지 조회
loginSmiChkVO.setEmplyrSttusCode("B"); // 신청대기중인 사용자까지 조회
LoginVO smiResultVO = loginService.actionLoginCmpChk(loginSmiChkVO);
if(null != smiResultVO.getId()) {
MberManageVO spamMberManageVO = new MberManageVO();
spamMberManageVO.setMberId(loginVO.getId());
MberManageVO spamMemberInfoVO = mberManageService.selectSpamMemberInfo(spamMberManageVO);
if(null != spamMemberInfoVO) {
redirectAttributes.addFlashAttribute("mberId", loginVO.getId());
return "redirect:/web/user/login/loginRestrictionUseBefore.do";
}
}
resultVO = loginService.actionLogin(loginVO);
LoginVO passMissVO = loginService.selectPassMiss(loginVO);
String alertMessage = "";
if (!"admin".equals(loginVO.getId())) {
//아이디가 존재
if(passMissVO != null) {
// 로그인 실패 (
if (null == resultVO.getId() && passMissVO.getPassMiss() < 5 ) {
loginService.updatePassMissPlus(loginVO);
alertMessage = egovMessageSource.getMessage("fail.common.login");
// 로그인 실패시 해킹의심 IP 테이블에 등록_아이디는 있지만 비밀번호가 틀린상황
/// HackIpVO hackIpVO = new HackIpVO();
hackIpVO.setHackUserId(loginVO.getId());
hackIpVO.setAccessIp( EgovClntInfo.getClntIP(request));
hackIpService.insertHackIp(hackIpVO);
if (loginVO.getBeforeUrl().toString().contains("/web/user/login/login.do")) {
redirectAttributes.addFlashAttribute("fail", true);
return "redirect:/web/user/login/login.do";
}
return goUserLoginPage(redirectAttributes, loginVO, request, model, alertMessage);
} else {
if (passMissVO.getPassMiss() >= 5) {
alertMessage = "패스워드가 5회 이상 틀려 로그인 할수 없습니다. 비밀번호를 재설정해주세요.";
return goUserPassMissPage(redirectAttributes, loginVO, request, model, alertMessage);
} /*
* else if("A".equals(resultVO.getEmplyrSttusCode())){ //신청상태 alertMessage =
* "신청하신 아이디가 현제 승인대기 상" + "태입니다."; return goUserLoginPage(redirectAttributes,
* request, model, alertMessage); }else
* if("B".equals(resultVO.getEmplyrSttusCode())){ //신청상태 alertMessage =
* "아이디가 차단상태가 되어 사용할수 없습니다."; return goUserLoginPage(redirectAttributes,
* request, model, alertMessage); }
*/
loginService.updatePassMissReset(loginVO);
}
}
//아이디 미존재
else {
alertMessage = egovMessageSource.getMessage("fail.common.login");
// 로그인 실패시 해킹의심 IP 테이블에 등록_아이디없고 비밀번호도 틀린상황
/// HackIpVO hackIpVO = new HackIpVO();
hackIpVO.setHackUserId(loginVO.getId());
hackIpVO.setAccessIp(EgovClntInfo.getClntIP(request));
hackIpService.insertHackIp(hackIpVO);
if (loginVO.getBeforeUrl().toString().contains("/web/user/login/login.do")) {
redirectAttributes.addFlashAttribute("fail", true);
return "redirect:/web/user/login/login.do";
}
return goUserLoginPage(redirectAttributes, loginVO, request, model, alertMessage);
}
}
/* 일시 : 2023.07.26
* 내용 : 로그인시 휴먼고객 redirect 기능 추가
* 작업자 : 원영현 과장
*/
if(resultVO.getDormantYn().equals("Y") || resultVO.getDormantYn() == "Y") {
return "redirect:/web/user/humanPage.do";
}
boolean loginPolicyYn = true;
// 접속IP
// userIp = EgovClntInfo.getClntIP(request);
// resultVO.siteId 로그인 ip를 조회함
if (resultVO != null && resultVO.getId() != null && !resultVO.getId().equals("") && loginPolicyYn) {
// 세션에다 ip 등록
resultVO.setIp(userIp);
// 2. spring security 연동
request.getSession().setAttribute("LoginVO", resultVO);
UsernamePasswordAuthenticationFilter springSecurity = null;
ApplicationContext act = WebApplicationContextUtils.getRequiredWebApplicationContext(request.getSession().getServletContext());
Map<String, UsernamePasswordAuthenticationFilter> beans = act.getBeansOfType(UsernamePasswordAuthenticationFilter.class);
if (beans.size() > 0) {
springSecurity = (UsernamePasswordAuthenticationFilter) beans.values().toArray()[0];
springSecurity.setUsernameParameter("egov_security_username");
springSecurity.setPasswordParameter("egov_security_password");
springSecurity.setRequiresAuthenticationRequestMatcher(new AntPathRequestMatcher(request.getServletContext().getContextPath() + "/egov_security_login", "POST"));
} else {
throw new IllegalStateException("No AuthenticationProcessingFilter");
}
springSecurity.doFilter(new RequestWrapperForSecurity(request, resultVO.getUserSe() + resultVO.getId(), resultVO.getUniqId()), response, null);
{ // 관리자 로그인 log 저장
String uniqId = "";
String ip = "";
/* Authenticated */
LoginLog loginLog = new LoginLog();
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
if (isAuthenticated.booleanValue()) {
LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
uniqId = user.getUniqId();
ip = EgovClntInfo.getClntIP(request);
HttpSession httpSession = request.getSession(true);
{
List<SiteManagerVO> siteManageList = new ArrayList<SiteManagerVO>();
SiteManagerVO siteManagerVO = new SiteManagerVO();
siteManagerVO.setFirstIndex(0);
siteManagerVO.setRecordCountPerPage(100);
siteManageList = egovSiteManagerService.selectSiteManagerList(siteManagerVO);
httpSession.setAttribute("siteManageList", siteManageList);
httpSession.setAttribute("loginId", user.getId()); // 자동완성 공통으로 쓰기위해
httpSession.setAttribute("esntlId", user.getPassword());
// 최근검색어 조회 세션에 넣어줌
/*
* UserManageVO tempUserManageVO = new UserManageVO();
* tempUserManageVO.setEmplyrId(user.getId()); tempUserManageVO =
* userManageService.selectRecentSearchWord(tempUserManageVO);
*
* List<String> lisRecentSearch = new ArrayList<String>(); if(null !=
* tempUserManageVO){ //ArrayList 세션 저장
* Collections.addAll(lisRecentSearch,tempUserManageVO.getSearchWord().split(","
* )) ; } httpSession.setAttribute("recentSearch", lisRecentSearch) ;
*/
}
}
/*
* loginLog.setLoginId(uniqId); loginLog.setLoginIp(ip);
* loginLog.setLoginMthd("I"); // 로그인:I, 로그아웃:O loginLog.setErrOccrrAt("N");
* loginLog.setErrorCode(""); //로그인은 관리자, PC만 loginLog.setUserAt("U"); //사용자
* loginLog.setDeviceType("P"); //PC loginLog.setProgrmFileNm("adminLogin");
* loginLog.setMenuNm("관리자로그인"); loginLogService.logInsertLoginLog(loginLog);
*/
loginVO.getId();
loginVO.getIp();
loginVO.setMessage("로그인 성공되었습니다.");
loginVO.setLoginYn("Y");
loginService.insertActionLoginLog(loginVO);
}
// 등급제 Start
// 회원별 등급 적용
MberGrdVO mberGrdVO = new MberGrdVO();
mberGrdVO.setMberId(loginVO.getId());
mberGrdVO.setAmt("0");
mberGrdVO.setMoid("");
mberGrdService.mberGrdSaveByUserNoHist(mberGrdVO);
// End
// 이벤트 결제 바로가기 로직 체크 Start
String goEventPay = (String) commandMap.get("goEventPay");
System.out.println("goEventPay : " + goEventPay);
if (null != goEventPay && goEventPay.equals("Y")) {
// 이벤트 결제 바로가기
if (goEventPay(loginVO) == true) {
loginVO.setBeforeUrl("/web/event/member/pay/PayView.do");
}
}
// End
String beforeUrl = (String) commandMap.get("beforeUrl");
// 로그인 URL 호출
if (loginVO.getBeforeUrl() != null && !("").equals(loginVO.getBeforeUrl())) {
request.getSession().setAttribute("usrBeforeUrl", loginVO.getBeforeUrl());
// 회원가입 메세지 처리
if (loginVO.getMessage() != null && !("").equals(loginVO.getMessage())) {
request.getSession().setAttribute("registMessage", loginVO.getMessage());
}
}
// 개인키 삭제
// 성공시 웹페이지 분기로 인해 session에 페이지 타입을 넣어준다.
request.getSession().setAttribute("pageType", "web");
return "blank"; // 성공 페이지.. (redirect 불가)
// uat/uia/actionMain.do 실제 성공시 무조건 좌측 메소드로 .
// return "forward:/web/main/mainPage.do";
} else {
String message = egovMessageSource.getMessage("fail.common.login");
redirectAttributes.addFlashAttribute("beforeUrl", loginVO.getBeforeUrl());
redirectAttributes.addFlashAttribute("message", message);
return "redirect:/";
}
}
/**
* @Method Name : selectUserSttusAjax
* @작성일 : 2024. 3. 27.
* @작성자 : WYH
* @변경이력 :
* @Method 설명 : 회원상태 조회 (Y:일반회원, B:이용정지 회원, N:탈퇴회원)
*/
/*
@RequestMapping(value = { "/web/user/login/actionSecurityLoginAjax.do" })
public ModelAndView actionSecurityLoginAjax(@ModelAttribute("loginVO") LoginVO loginVO, HttpServletResponse response,
HttpServletRequest request, @RequestParam Map<String, Object> commandMap, ModelMap model,
HttpSession session, RedirectAttributes redirectAttributes) throws Exception {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView");
String p_id = "";
String p_pwd = "";
try {
//id, pwd 로그인 하고 결과와 hp 번호를 돌려주면
p_id = request.getParameter("id");
p_pwd = request.getParameter("password");
String userId = mjonMsgVO.getUserId();
String userSttus = userManageService.selectUserStatusInfoCheck(userId);
modelAndView.addObject("status", "success");
modelAndView.addObject("userSttus", userSttus);
} catch (Exception e) {
modelAndView.addObject("status", "fail");
modelAndView.addObject("msg", "인증에 실패하였습니다.");
}
return modelAndView;
}
*/
@RequestMapping(value = "/web/user/login/actionSecurityLoginBeforeHpAjax.do")
public ModelAndView selectActionSecurityLoginWebBeforeHp(@ModelAttribute("loginVO") LoginVO loginVO, HttpServletResponse response,
HttpServletRequest request, @RequestParam Map<String, Object> commandMap, ModelMap model,
HttpSession session, RedirectAttributes redirectAttributes) throws Exception {
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("jsonView");
String userIp = EgovClntInfo.getClntIP(request);
HackIpVO hackIpVO = new HackIpVO();
hackIpVO.setAccessIp(userIp);
hackIpVO.setBlockYn("Y");
if (null != hackIpService.selectHackIpVO(hackIpVO)) {
String message = "차단된 아이피입니다. 관리자에게 문의해 주십시요.";
modelAndView.addObject("status", "fail");
modelAndView.addObject("msg", message);
return modelAndView;
}
/*ScriptEngineManager engine = new ScriptEngineManager();*/
loginVO.setUserSe("USR");
// 로그인 정보 check
if (loginVO.getId() == null || loginVO.getPassword() == null) {
// 회원가입 로그인 처리
LoginVO pLoginVO = (LoginVO) request.getAttribute("pLoginVO");
if (pLoginVO == null) {
// RSA 생성
initRsa(request);
/* return "redirect:/web/user/login/login.do"; */
//return "redirect:/";
String message = "로그인 실패했습니다.";
modelAndView.addObject("status", "fail");
modelAndView.addObject("msg", message);
return modelAndView;
} else {
loginVO.setId(pLoginVO.getId());
loginVO.setPassword(pLoginVO.getPassword());
loginVO.setBeforeUrl(pLoginVO.getBeforeUrl());
loginVO.setMessage(pLoginVO.getMessage());
}
}
// 1. 일반 로그인 처리
PrivateKey privateKey = (PrivateKey) session.getAttribute(EgovLoginController.RSA_WEB_KEY);
if (privateKey == null) {
initRsa(request);
/*return "web/site/login/EgovLoginGnrlUsr";*/
String message = "아이디와 비밀번호를 확인해주세요.";
redirectAttributes.addFlashAttribute("message", message);
System.out.println("======================================================");
System.out.println("= RSA privateKey is null =");
System.out.println("======================================================");
modelAndView.addObject("status", "fail");
modelAndView.addObject("msg", message);
return modelAndView;
}
LoginVO resultVO;
// 복호화
String id = "";
try {
//아이디 복호화 소문자 변환
id = decryptRsa(privateKey, loginVO.getId()).toLowerCase();
} catch (Exception e) {
initRsa(request);
String message = "로그인 실패했습니다.";
modelAndView.addObject("status", "fail");
modelAndView.addObject("msg", message);
return modelAndView;
}
String password = decryptRsa(privateKey, loginVO.getPassword());
loginVO.setId(id);
loginVO.setIp(EgovClntInfo.getClntIP(request));
loginVO.setPassword(password);
loginVO.setUserSe("GNR");
loginVO.setStatusAll("Y"); // 신청대기중인 사용자까지 조회
//기업회원 가입중인지 체크 - 기존 로그인 select는 MBER_STTUS = 'Y' 하드코딩이라 로그인 기업회원 가입중인지 체크
//암호화 2번 방지를 위한 LoginVO 생성
LoginVO loginCmpChkVO = new LoginVO();
loginCmpChkVO.setId(id);
loginCmpChkVO.setIp(EgovClntInfo.getClntIP(request));
loginCmpChkVO.setPassword(password);
loginCmpChkVO.setUserSe("GNR");
loginCmpChkVO.setStatusAll("Y"); // 신청대기중인 사용자까지 조회
loginCmpChkVO.setEmplyrSttusCode("A"); // 신청대기중인 사용자까지 조회
LoginVO cmpHstResultVO = loginService.actionLoginCmpChk(loginCmpChkVO);
if(null != cmpHstResultVO.getId()) {
//기업회원 정보 마지막 내역 조회
MberManageVO mberManageVO = new MberManageVO();
mberManageVO.setMberId(loginVO.getId());
MberManageVO cmpChangeManageVO = mberManageService.selectCmpUsrHst(mberManageVO);
if(null != cmpChangeManageVO) {
if("01".equals(cmpChangeManageVO.getHstType())) { //가장 마지막 내역이 기업회원 가입일
if("01".equals(cmpChangeManageVO.getHstSttus()) || "03".equals(cmpChangeManageVO.getHstSttus()) ) { //가장 마지막 기업회원 가입이 신청 또는 반려 상태일
String message = "기업회원 신청 또는 반려상태입니다.";
modelAndView.addObject("status", "fail");
modelAndView.addObject("msg", message);
return modelAndView;
}
}
}
}
//스팸처리 회원인지 mj_spam_member_info 해당 ID의 최근 1개 데이터 조회
LoginVO loginSmiChkVO = new LoginVO();
loginSmiChkVO.setId(id);
loginSmiChkVO.setIp(EgovClntInfo.getClntIP(request));
loginSmiChkVO.setPassword(password);
loginSmiChkVO.setUserSe("GNR");
loginSmiChkVO.setStatusAll("Y"); // 신청대기중인 사용자까지 조회
loginSmiChkVO.setEmplyrSttusCode("B"); // 신청대기중인 사용자까지 조회
LoginVO smiResultVO = loginService.actionLoginCmpChk(loginSmiChkVO);
if(null != smiResultVO.getId()) {
MberManageVO spamMberManageVO = new MberManageVO();
spamMberManageVO.setMberId(loginVO.getId());
MberManageVO spamMemberInfoVO = mberManageService.selectSpamMemberInfo(spamMberManageVO);
if(null != spamMemberInfoVO) {
String message = "신청대기중인 상태입니다.";
modelAndView.addObject("status", "fail");
modelAndView.addObject("msg", message);
return modelAndView;
}
}
resultVO = loginService.actionLogin(loginVO);
LoginVO passMissVO = loginService.selectPassMiss(loginVO);
String alertMessage = "";
if (!"admin".equals(loginVO.getId())) {
//아이디가 존재
if(passMissVO != null) {
// 로그인 실패 (
if (null == resultVO.getId() && passMissVO.getPassMiss() < 5 ) {
loginService.updatePassMissPlus(loginVO);
alertMessage = egovMessageSource.getMessage("fail.common.login");
// 로그인 실패시 해킹의심 IP 테이블에 등록_아이디는 있지만 비밀번호가 틀린상황
/// HackIpVO hackIpVO = new HackIpVO();
hackIpVO.setHackUserId(loginVO.getId());
hackIpVO.setAccessIp( EgovClntInfo.getClntIP(request));
hackIpService.insertHackIp(hackIpVO);
if (loginVO.getBeforeUrl().toString().contains("/web/user/login/login.do")) {
String message = "로그인 실패했습니다.";
modelAndView.addObject("status", "fail");
modelAndView.addObject("msg", message);
return modelAndView;
}
String message = "로그인 실패했습니다.";
modelAndView.addObject("status", "fail");
modelAndView.addObject("msg", message);
return modelAndView;
} else {
if (passMissVO.getPassMiss() >= 5) {
//alertMessage = "패스워드가 5회 이상 틀려 로그인 할수 없습니다. 비밀번호를 재설정해주세요.";
String message = "패스워드가 5회 이상 틀려 로그인 할수 없습니다. 비밀번호를 재설정해주세요.";
modelAndView.addObject("status", "fail");
modelAndView.addObject("msg", message);
return modelAndView;
} /*
* else if("A".equals(resultVO.getEmplyrSttusCode())){ //신청상태 alertMessage =
* "신청하신 아이디가 현제 승인대기 상" + "태입니다."; return goUserLoginPage(redirectAttributes,
* request, model, alertMessage); }else
* if("B".equals(resultVO.getEmplyrSttusCode())){ //신청상태 alertMessage =
* "아이디가 차단상태가 되어 사용할수 없습니다."; return goUserLoginPage(redirectAttributes,
* request, model, alertMessage); }
*/
loginService.updatePassMissReset(loginVO);
}
}
//아이디 미존재
else {
alertMessage = egovMessageSource.getMessage("fail.common.login");
// 로그인 실패시 해킹의심 IP 테이블에 등록_아이디없고 비밀번호도 틀린상황
/// HackIpVO hackIpVO = new HackIpVO();
hackIpVO.setHackUserId(loginVO.getId());
hackIpVO.setAccessIp(EgovClntInfo.getClntIP(request));
hackIpService.insertHackIp(hackIpVO);
if (loginVO.getBeforeUrl().toString().contains("/web/user/login/login.do")) {
String message = "로그인 실패했습니다.";
modelAndView.addObject("status", "fail");
modelAndView.addObject("msg", message);
return modelAndView;
}
String message = "로그인 실패했습니다.";
modelAndView.addObject("status", "fail");
modelAndView.addObject("msg", message);
return modelAndView;
}
}
/* 일시 : 2023.07.26
* 내용 : 로그인시 휴먼고객 redirect 기능 추가
* 작업자 : 원영현 과장
*/
if(resultVO.getDormantYn().equals("Y") || resultVO.getDormantYn() == "Y") {
String message = "휴면계정입니다.";
modelAndView.addObject("status", "fail");
modelAndView.addObject("msg", message);
return modelAndView;
}
String message = "로그인 성공했습니다.";
modelAndView.addObject("status", "success");
modelAndView.addObject("msg", message);
modelAndView.addObject("data", resultVO);
return modelAndView;
}
@RequestMapping(value = "/web/user/login/actionSecurityLogin_ori_00.do")
public String selectActionSecurityLoginWeb(@ModelAttribute("loginVO") LoginVO loginVO, HttpServletResponse response,
HttpServletRequest request, @RequestParam Map<String, Object> commandMap, ModelMap model,
HttpSession session, RedirectAttributes redirectAttributes) throws Exception {
@ -1772,6 +2361,340 @@ public class EgovLoginController {
}
}
@RequestMapping(value = "/web/user/login/actionSecurityLoginAfterHp.do")
public String selectActionSecurityLoginWebAfterHp(@ModelAttribute("loginVO") LoginVO loginVO, HttpServletResponse response,
HttpServletRequest request, @RequestParam Map<String, Object> commandMap, ModelMap model,
HttpSession session, RedirectAttributes redirectAttributes) throws Exception {
String userIp = EgovClntInfo.getClntIP(request);
HackIpVO hackIpVO = new HackIpVO();
hackIpVO.setAccessIp(userIp);
hackIpVO.setBlockYn("Y");
if (null != hackIpService.selectHackIpVO(hackIpVO)) {
String message = "차단된 아이피입니다. 관리자에게 문의해 주십시요.";
redirectAttributes.addFlashAttribute("message", message);
return "redirect:/";
}
/*ScriptEngineManager engine = new ScriptEngineManager();*/
loginVO.setUserSe("USR");
// 로그인 정보 check
if (loginVO.getId() == null || loginVO.getPassword() == null) {
// 회원가입 로그인 처리
LoginVO pLoginVO = (LoginVO) request.getAttribute("pLoginVO");
if (pLoginVO == null) {
// RSA 생성
initRsa(request);
/* return "redirect:/web/user/login/login.do"; */
return "redirect:/";
} else {
loginVO.setId(pLoginVO.getId());
loginVO.setPassword(pLoginVO.getPassword());
loginVO.setBeforeUrl(pLoginVO.getBeforeUrl());
loginVO.setMessage(pLoginVO.getMessage());
}
}
// 1. 일반 로그인 처리
PrivateKey privateKey = (PrivateKey) session.getAttribute(EgovLoginController.RSA_WEB_KEY);
if (privateKey == null) {
initRsa(request);
/*return "web/site/login/EgovLoginGnrlUsr";*/
String message = "아이디와 비밀번호를 확인해주세요.";
redirectAttributes.addFlashAttribute("message", message);
System.out.println("======================================================");
System.out.println("= RSA privateKey is null =");
System.out.println("======================================================");
return "redirect:/web/main/mainPage.do";
}
LoginVO resultVO;
// 복호화
String id = "";
try {
//아이디 복호화 소문자 변환
id = decryptRsa(privateKey, loginVO.getId()).toLowerCase();
} catch (Exception e) {
initRsa(request);
// return "redirect:/web/user/login/login.do";
if (loginVO.getBeforeUrl().toString().contains("/web/user/login/login.do")) {
redirectAttributes.addFlashAttribute("fail", true);
return "redirect:/web/user/login/login.do";
}
return "redirect:/";
}
//핸드폰 인증번호 확인
String s_hp = request.getParameter("hp");
String s_num = request.getParameter("num");
System.out.println(s_hp);
System.out.println(s_num);
System.out.println("s_num==============");
SendLogVO sendLogVO = new SendLogVO();
sendLogVO.setSendId(id);
sendLogVO.setReceive(s_hp);
sendLogVO.setCheckNo(s_num);
sendLogVO = mjonMsgDataService.selectSysMsgLogCheck(sendLogVO);
if (sendLogVO==null) {
redirectAttributes.addFlashAttribute("fail2", true);
return "redirect:/web/user/login/login.do";
}
String password = decryptRsa(privateKey, loginVO.getPassword());
loginVO.setId(id);
loginVO.setIp(EgovClntInfo.getClntIP(request));
loginVO.setPassword(password);
loginVO.setUserSe("GNR");
loginVO.setStatusAll("Y"); // 신청대기중인 사용자까지 조회
//기업회원 가입중인지 체크 - 기존 로그인 select는 MBER_STTUS = 'Y' 하드코딩이라 로그인 기업회원 가입중인지 체크
//암호화 2번 방지를 위한 LoginVO 생성
LoginVO loginCmpChkVO = new LoginVO();
loginCmpChkVO.setId(id);
loginCmpChkVO.setIp(EgovClntInfo.getClntIP(request));
loginCmpChkVO.setPassword(password);
loginCmpChkVO.setUserSe("GNR");
loginCmpChkVO.setStatusAll("Y"); // 신청대기중인 사용자까지 조회
loginCmpChkVO.setEmplyrSttusCode("A"); // 신청대기중인 사용자까지 조회
LoginVO cmpHstResultVO = loginService.actionLoginCmpChk(loginCmpChkVO);
if(null != cmpHstResultVO.getId()) {
//기업회원 정보 마지막 내역 조회
MberManageVO mberManageVO = new MberManageVO();
mberManageVO.setMberId(loginVO.getId());
MberManageVO cmpChangeManageVO = mberManageService.selectCmpUsrHst(mberManageVO);
if(null != cmpChangeManageVO) {
if("01".equals(cmpChangeManageVO.getHstType())) { //가장 마지막 내역이 기업회원 가입일
if("01".equals(cmpChangeManageVO.getHstSttus()) || "03".equals(cmpChangeManageVO.getHstSttus()) ) { //가장 마지막 기업회원 가입이 신청 또는 반려 상태일
redirectAttributes.addFlashAttribute("mberId", loginVO.getId());
//addFlashAttribute 일회성으로 인하여 membershipAttachDocBefore.do 이동
//membershipAttachDoc.do로 바로 submit하여 새로고침 정보 유지되게 처리
return "redirect:/web/user/login/membershipAttachDocBefore.do";
}
}
}
}
//스팸처리 회원인지 mj_spam_member_info 해당 ID의 최근 1개 데이터 조회
LoginVO loginSmiChkVO = new LoginVO();
loginSmiChkVO.setId(id);
loginSmiChkVO.setIp(EgovClntInfo.getClntIP(request));
loginSmiChkVO.setPassword(password);
loginSmiChkVO.setUserSe("GNR");
loginSmiChkVO.setStatusAll("Y"); // 신청대기중인 사용자까지 조회
loginSmiChkVO.setEmplyrSttusCode("B"); // 신청대기중인 사용자까지 조회
LoginVO smiResultVO = loginService.actionLoginCmpChk(loginSmiChkVO);
if(null != smiResultVO.getId()) {
MberManageVO spamMberManageVO = new MberManageVO();
spamMberManageVO.setMberId(loginVO.getId());
MberManageVO spamMemberInfoVO = mberManageService.selectSpamMemberInfo(spamMberManageVO);
if(null != spamMemberInfoVO) {
redirectAttributes.addFlashAttribute("mberId", loginVO.getId());
return "redirect:/web/user/login/loginRestrictionUseBefore.do";
}
}
resultVO = loginService.actionLogin(loginVO);
LoginVO passMissVO = loginService.selectPassMiss(loginVO);
String alertMessage = "";
if (!"admin".equals(loginVO.getId())) {
//아이디가 존재
if(passMissVO != null) {
// 로그인 실패 (
if (null == resultVO.getId() && passMissVO.getPassMiss() < 5 ) {
loginService.updatePassMissPlus(loginVO);
alertMessage = egovMessageSource.getMessage("fail.common.login");
// 로그인 실패시 해킹의심 IP 테이블에 등록_아이디는 있지만 비밀번호가 틀린상황
/// HackIpVO hackIpVO = new HackIpVO();
hackIpVO.setHackUserId(loginVO.getId());
hackIpVO.setAccessIp( EgovClntInfo.getClntIP(request));
hackIpService.insertHackIp(hackIpVO);
if (loginVO.getBeforeUrl().toString().contains("/web/user/login/login.do")) {
redirectAttributes.addFlashAttribute("fail", true);
return "redirect:/web/user/login/login.do";
}
return goUserLoginPage(redirectAttributes, loginVO, request, model, alertMessage);
} else {
if (passMissVO.getPassMiss() >= 5) {
alertMessage = "패스워드가 5회 이상 틀려 로그인 할수 없습니다. 비밀번호를 재설정해주세요.";
return goUserPassMissPage(redirectAttributes, loginVO, request, model, alertMessage);
} /*
* else if("A".equals(resultVO.getEmplyrSttusCode())){ //신청상태 alertMessage =
* "신청하신 아이디가 현제 승인대기 상" + "태입니다."; return goUserLoginPage(redirectAttributes,
* request, model, alertMessage); }else
* if("B".equals(resultVO.getEmplyrSttusCode())){ //신청상태 alertMessage =
* "아이디가 차단상태가 되어 사용할수 없습니다."; return goUserLoginPage(redirectAttributes,
* request, model, alertMessage); }
*/
loginService.updatePassMissReset(loginVO);
}
}
//아이디 미존재
else {
alertMessage = egovMessageSource.getMessage("fail.common.login");
// 로그인 실패시 해킹의심 IP 테이블에 등록_아이디없고 비밀번호도 틀린상황
/// HackIpVO hackIpVO = new HackIpVO();
hackIpVO.setHackUserId(loginVO.getId());
hackIpVO.setAccessIp(EgovClntInfo.getClntIP(request));
hackIpService.insertHackIp(hackIpVO);
if (loginVO.getBeforeUrl().toString().contains("/web/user/login/login.do")) {
redirectAttributes.addFlashAttribute("fail", true);
return "redirect:/web/user/login/login.do";
}
return goUserLoginPage(redirectAttributes, loginVO, request, model, alertMessage);
}
}
/* 일시 : 2023.07.26
* 내용 : 로그인시 휴먼고객 redirect 기능 추가
* 작업자 : 원영현 과장
*/
if(resultVO.getDormantYn().equals("Y") || resultVO.getDormantYn() == "Y") {
return "redirect:/web/user/humanPage.do";
}
boolean loginPolicyYn = true;
// 접속IP
// userIp = EgovClntInfo.getClntIP(request);
// resultVO.siteId 로그인 ip를 조회함
if (resultVO != null && resultVO.getId() != null && !resultVO.getId().equals("") && loginPolicyYn) {
// 세션에다 ip 등록
resultVO.setIp(userIp);
// 2. spring security 연동
request.getSession().setAttribute("LoginVO", resultVO);
UsernamePasswordAuthenticationFilter springSecurity = null;
ApplicationContext act = WebApplicationContextUtils.getRequiredWebApplicationContext(request.getSession().getServletContext());
Map<String, UsernamePasswordAuthenticationFilter> beans = act.getBeansOfType(UsernamePasswordAuthenticationFilter.class);
if (beans.size() > 0) {
springSecurity = (UsernamePasswordAuthenticationFilter) beans.values().toArray()[0];
springSecurity.setUsernameParameter("egov_security_username");
springSecurity.setPasswordParameter("egov_security_password");
springSecurity.setRequiresAuthenticationRequestMatcher(new AntPathRequestMatcher(request.getServletContext().getContextPath() + "/egov_security_login", "POST"));
} else {
throw new IllegalStateException("No AuthenticationProcessingFilter");
}
springSecurity.doFilter(new RequestWrapperForSecurity(request, resultVO.getUserSe() + resultVO.getId(), resultVO.getUniqId()), response, null);
{ // 관리자 로그인 log 저장
String uniqId = "";
String ip = "";
/* Authenticated */
LoginLog loginLog = new LoginLog();
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
if (isAuthenticated.booleanValue()) {
LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
uniqId = user.getUniqId();
ip = EgovClntInfo.getClntIP(request);
HttpSession httpSession = request.getSession(true);
{
List<SiteManagerVO> siteManageList = new ArrayList<SiteManagerVO>();
SiteManagerVO siteManagerVO = new SiteManagerVO();
siteManagerVO.setFirstIndex(0);
siteManagerVO.setRecordCountPerPage(100);
siteManageList = egovSiteManagerService.selectSiteManagerList(siteManagerVO);
httpSession.setAttribute("siteManageList", siteManageList);
httpSession.setAttribute("loginId", user.getId()); // 자동완성 공통으로 쓰기위해
httpSession.setAttribute("esntlId", user.getPassword());
// 최근검색어 조회 세션에 넣어줌
/*
* UserManageVO tempUserManageVO = new UserManageVO();
* tempUserManageVO.setEmplyrId(user.getId()); tempUserManageVO =
* userManageService.selectRecentSearchWord(tempUserManageVO);
*
* List<String> lisRecentSearch = new ArrayList<String>(); if(null !=
* tempUserManageVO){ //ArrayList 세션 저장
* Collections.addAll(lisRecentSearch,tempUserManageVO.getSearchWord().split(","
* )) ; } httpSession.setAttribute("recentSearch", lisRecentSearch) ;
*/
}
}
/*
* loginLog.setLoginId(uniqId); loginLog.setLoginIp(ip);
* loginLog.setLoginMthd("I"); // 로그인:I, 로그아웃:O loginLog.setErrOccrrAt("N");
* loginLog.setErrorCode(""); //로그인은 관리자, PC만 loginLog.setUserAt("U"); //사용자
* loginLog.setDeviceType("P"); //PC loginLog.setProgrmFileNm("adminLogin");
* loginLog.setMenuNm("관리자로그인"); loginLogService.logInsertLoginLog(loginLog);
*/
loginVO.getId();
loginVO.getIp();
loginVO.setMessage("로그인 성공되었습니다.");
loginVO.setLoginYn("Y");
loginService.insertActionLoginLog(loginVO);
}
// 등급제 Start
// 회원별 등급 적용
MberGrdVO mberGrdVO = new MberGrdVO();
mberGrdVO.setMberId(loginVO.getId());
mberGrdVO.setAmt("0");
mberGrdVO.setMoid("");
mberGrdService.mberGrdSaveByUserNoHist(mberGrdVO);
// End
// 이벤트 결제 바로가기 로직 체크 Start
String goEventPay = (String) commandMap.get("goEventPay");
System.out.println("goEventPay : " + goEventPay);
if (null != goEventPay && goEventPay.equals("Y")) {
// 이벤트 결제 바로가기
if (goEventPay(loginVO) == true) {
loginVO.setBeforeUrl("/web/event/member/pay/PayView.do");
}
}
// End
String beforeUrl = (String) commandMap.get("beforeUrl");
// 로그인 URL 호출
if (loginVO.getBeforeUrl() != null && !("").equals(loginVO.getBeforeUrl())) {
request.getSession().setAttribute("usrBeforeUrl", loginVO.getBeforeUrl());
// 회원가입 메세지 처리
if (loginVO.getMessage() != null && !("").equals(loginVO.getMessage())) {
request.getSession().setAttribute("registMessage", loginVO.getMessage());
}
}
// 개인키 삭제
// 성공시 웹페이지 분기로 인해 session에 페이지 타입을 넣어준다.
request.getSession().setAttribute("pageType", "web");
return "blank"; // 성공 페이지.. (redirect 불가)
// uat/uia/actionMain.do 실제 성공시 무조건 좌측 메소드로 .
// return "forward:/web/main/mainPage.do";
} else {
String message = egovMessageSource.getMessage("fail.common.login");
redirectAttributes.addFlashAttribute("beforeUrl", loginVO.getBeforeUrl());
redirectAttributes.addFlashAttribute("message", message);
return "redirect:/";
}
}
// 이벤트 결제 바로가기
public boolean goEventPay(LoginVO loginVO) throws Exception {
boolean goEventPay = false;
@ -2647,7 +3570,7 @@ public class EgovLoginController {
String resultBlockSts = "0";
// 비밀번호 찾기 문자내용
String contents = "[문자온] 비밀번호 변경 인증번호 : %code%";
String contents = "[문자온] 인증번호 : %code%";
String code = "";
long seed = System.currentTimeMillis();
Random random = new Random(seed);

View File

@ -3702,6 +3702,26 @@
LIMIT 1
</select>
<select id="mjonMsgDAO.selectSysMsgLogCheck" parameterClass="SendLogVO" resultClass="SendLogVO">
SELECT a.SEND_ID AS sendId,
a.SEND_TYPE AS sendType,
a.FRST_SEND_INFO AS frstSendInfo,
a.RECEIVE AS receive,
a.FRST_SEND_PNTTM AS frstSendPnttm,
a.CHECK_NO AS checkNo,
a.CONTENTS AS contents
FROM mj_system_send a
, lettngnrlmber b
WHERE 1 =1
and b.MBER_ID = #sendId#
and b.MBTLNUM=#receive#
and b.MBTLNUM=a.RECEIVE
and a.CHECK_NO=#checkNo#
ORDER BY a.FRST_SEND_PNTTM DESC, a.SEND_ID DESC
LIMIT 1
</select>
<!-- 발신번호 등록 여부 조회 -->
<select id="mjonMsgDAO.selectSendPhonNumCheck" parameterClass="mjonMsgVO" resultClass="int">
SELECT

View File

@ -292,6 +292,8 @@ function whoisIpCountry() {
}
function actionLogin() {
location.href="<c:url value='/web/user/login/login.do'/>";
/*
// 아이디 공백 제거
document.loginForm.id_text.value = $.trim(document.loginForm.id_text.value);
@ -328,6 +330,7 @@ function actionLogin() {
}, 600);
}
*/
}
function saveid(form) {

View File

@ -138,6 +138,199 @@ function whoisIpCountry() {
}
function actionLogin(){
setTimeout(function() {
if (isKoreaIpAddress == false) {
alert("해외 IP로 감지되어 로그인이 제한되었습니다.\n문자온 고객센터로 문의 바랍니다.");
location.href='/web/uat/uia/actionLogout.do';
return false;
}
// 로그인 START
var rsa = new RSAKey();
rsa.setPublic($('#RSAModulus2').val(),$('#RSAExponent2').val());
/* rsa.setPublic(document.loginForm2.RSAModulus.value, document.loginForm2.RSAExponent.value); */
var id = $("#id_text2");
var pw = $("#password_text2");
/* var id = document.loginForm2.id_text;
var pw = document.loginForm2.password_text; */
/* $("#id").val(rsa.encrypt(id.val())); */
/* $("#password").val(rsa.encrypt(pw.val())); */
document.loginForm2.id.value = rsa.encrypt(id.val().toLowerCase());
document.loginForm2.password.value = rsa.encrypt(pw.val());
//document.loginForm2.action="<c:url value='/web/user/login/actionSecurityLogin.do'/>";
saveid(document.loginForm2);
//document.loginForm2.submit();
var checkForm = $("form[name=loginForm2]").serialize() ;
$.ajax({
type : "POST",
async : false,
url : "/web/user/login/actionSecurityLoginBeforeHpAjax.do",
data : checkForm,
dataType:'json',
success : function(data) {
//alert(data.status);
//alert(data.data.moblphonNo);
if (data.status=="success"){
//번호인증팝업 띄우기
$("#input_list_item_1").hide();
$("#input_list_item_2").hide();
$("#input_list_item_3").hide();
$("#input_list_item_0").hide();
$("#input_list_item_4").show();
$("#input_list_item_5").show();
$("#input_list_item_6").show();
$("#hp_text2").val(data.data.moblphonNo);
}else if (data.status=="fail"){
$("#ret_msg").show();
$("#ret_msg_info").html('<i></i>'+data.msg);
}
//alert(JSON.stringify(data));
console.log("sucess data1 : " + JSON.stringify(data));
if (data.isSuccess == true) {
console.log("fn_click_banner_add_stat sucess data2 : " + JSON.stringify(data));
}
else {
console.log("data.isSuccess not true ");
console.log("sucess data.msg : " + data.msg);
console.log("sucess data1 : " + JSON.stringify(data));
}
},
error : function(xhr, status, error) {
console.log("fn_click_banner_add_stat error : " + error);
console.log("fn_click_banner_add_stat xhr : " + JSON.stringify(xhr) + "\r\status : " + JSON.stringify(status) + "\r\error : " + JSON.stringify(error));
return false;
}
});
}, 600);
}
//아이디/휴대폰 번호 체크
function actionLogin_end(){
if (isKoreaIpAddress == false) {
alert("해외 IP로 감지되어 로그인이 제한되었습니다.\n문자온 고객센터로 문의 바랍니다.");
location.href='/web/uat/uia/actionLogout.do';
return false;
}
// 로그인 START
var rsa = new RSAKey();
rsa.setPublic($('#RSAModulus2').val(),$('#RSAExponent2').val());
/* rsa.setPublic(document.loginForm2.RSAModulus.value, document.loginForm2.RSAExponent.value); */
//var id = $("#id_text2");
//var pw = $("#password_text2");
var hp = $("#hp_text2").val();
var num = $("#num_text2").val();
/* var id = document.loginForm2.id_text;
var pw = document.loginForm2.password_text; */
/* $("#id").val(rsa.encrypt(id.val())); */
/* $("#password").val(rsa.encrypt(pw.val())); */
//document.loginForm2.id.value = rsa.encrypt(id.val().toLowerCase());
//document.loginForm2.password.value = rsa.encrypt(pw.val());
document.loginForm2.hp.value = hp;
document.loginForm2.num.value = num;
document.loginForm2.action="<c:url value='/web/user/login/actionSecurityLoginAfterHp.do'/>";
saveid(document.loginForm2);
document.loginForm2.submit();
}
//아이디/휴대폰 번호 체크
function step1IdCheck(){
document.checkForm.callTo.value = $('#hp_text2').val();
document.checkForm.userId.value = $('#id_text2').val().toLowerCase();
//document.checkForm.searchNm.value = $('#findPw_userNm').val();
if ($('#id_text2').val()==''){
alert("아이디를 입력해주세요.");
return;
}else if ($('#hp_text2').val()==''){
alert("핸드폰번호를 입력해주세요.");
return;
}
var checkForm = $("form[name=checkForm]").serialize() ;
$.ajax({
url : "<c:url value='/web/user/sendSysMsgDataAjax.do' />",
type : 'POST',
data : checkForm,
dataType:'json',
success : function(returnData, status){
if(status == "success") {
alert(returnData.message);
if(returnData.result == "success") {
timer();
}
}else{ alert("실패");return;}
},
error : function(request , status, error){
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
}
});
}
var time = 300; //기준시간 작성
var min = ""; //분
var sec = ""; //초
//인증번호 타이머
function timer(){
//setInterval(함수, 시간) : 주기적인 실행
var x = setInterval(function() {
//parseInt() : 정수를 반환
min = parseInt(time/60);
sec = time%60; //나머지를 계산
document.getElementById("timer").innerHTML = min + "분" + sec + "초";
time--;
//타임아웃 시
if (time < 0) {
clearInterval(x); //setInterval() 실행을 끝냄
document.getElementById("timer").innerHTML = "시간초과";
}
}, 1000);
if(time != 300){
time = 300;
clearInterval(x);
}
}
function actionLogin_bak(){
// Whois IP 국가코드
//whoisIpCountry();
setTimeout(function() {
@ -169,6 +362,39 @@ function actionLogin(){
}, 600);
}
//인증번호 발송 1분마다 한번씩 보내기
function sendMsgYn(){
document.checkForm.receive.value = $('#hp_text2').val();
if ($('#hp_text2').val()==''){
alert("휴대폰 번호를 입력해주세요.");
return;
}
var checkForm = $("form[name=checkForm]").serialize() ;
$.ajax({
url : "<c:url value='/web/user/sendSysMsgSelectAjax.do' />",
type : 'POST',
data : checkForm,
dataType:'json',
success : function(returnData, status){
if(status == "success") {
if(returnData.compare){
step1IdCheck();
}else{
alert("인증번호 발송은 1분마다 가능합니다.");
return;
}
}else{ alert("실패");return;}
},
error : function(request , status, error){
alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
}
});
}
function textClear(pram){
var area = pram;
$('#'+area).val('');
@ -284,6 +510,8 @@ function fn_click_banner_add_stat(bannerMenuCode){
<input type="hidden" id="id" name="id">
<input type="hidden" id="password" name="password">
<input type="hidden" name="goEventPay" value="${goEventPay}"/>
<input type="hidden" id="hp" name="hp">
<input type="hidden" id="num" name="num">
<div class="send_top">
<div class="mypage_content current">
@ -294,9 +522,9 @@ function fn_click_banner_add_stat(bannerMenuCode){
<div class="input_list">
<p class="welcome">
<span>문자온</span>에 오신것을 환영합니다.<br>
<span class="c_222 fwMd">로그인 </span>해주세요.
<span class="c_222 fwMd">로그인1 </span>해주세요.
</p>
<div class="input_list_item">
<div class="input_list_item" id="input_list_item_1">
<div class="input_left">아이디</div>
<div class="input_right">
<label for="list_inputType1" class="label">아이디</label>
@ -309,7 +537,7 @@ function fn_click_banner_add_stat(bannerMenuCode){
</button>
</div>
</div>
<div class="input_list_item">
<div class="input_list_item" id="input_list_item_2">
<div class="input_left">비밀번호</div>
<div class="input_right">
<label for="list_inputType1" class="label">비밀번호 입력</label>
@ -327,15 +555,61 @@ function fn_click_banner_add_stat(bannerMenuCode){
</div>
</div>
<c:if test="${fail}">
<div class="pass_no2">
<div class="pass_no2" id="input_list_item_0">
<p>
<i></i>아이디 또는 비밀번호가 일치하지 않습니다.
</p>
</div>
</c:if>
<div class="mem_btnWrap2">
<c:if test="${fail2}">
<div class="pass_no2" id="input_list_item_0">
<p>
<i></i>인증번호가 일치하지 않습니다.
</p>
</div>
</c:if>
<div class="pass_no2" style="display:none;" id="ret_msg">
<p id="ret_msg_info">
<i></i>아이디 또는 비밀번호가 일치하지 않습니다.
</p>
</div>
<div class="mem_btnWrap2" id="input_list_item_3">
<button type="button" class="mem_btn5" onclick="javascript:actionLoginPage(); return false;">로그인</button>
</div>
<div class="input_list_item" id="input_list_item_4" style="display:none;">
<div class="input_left">휴대폰번호</div>
<div class="input_right">
<label for="list_inputType1" class="label">휴대폰번호</label>
<input type="text" id="hp_text2" class="list_inputType1" placeholder="가입휴대폰번호" style="width: 250px;"
onfocus="this.placeholder=''" onblur="this.placeholder='가입휴대폰번호'" maxlength="20" readonly>
</div>
<div class="login_del">
<button type="button" onclick="sendMsgYn();">인증번호 받기</button>
</div>
</div>
<div class="input_list_item" id="input_list_item_5" style="display:none;">
<div class="input_left">인증번호 입력</div>
<div class="input_right">
<label for="list_inputType1" class="label">인증번호 입력</label>
<input type="text" id="num_text2" class="list_inputType1" placeholder="인증번호를 입력해주세요" maxlength="6"
onfocus="this.placeholder=''" onblur="this.placeholder='인증번호를 입력해주세요'" onkeypress="if(event.keyCode==13) {return false;}">
</div>
<div class="login_del">
<!-- <i class="password_protect"></i> -->
<button type="button" onclick="textClear('num_text2')" tabindex="-1">
<img src="/publish/images/content/login_del.png" alt="입력 삭제">
</button>
</div>
</div>
<div class="mem_btnWrap2" id="input_list_item_6" style="display:none;">
<button type="button" class="mem_btn5" onclick="javascript:actionLogin_end(); return false;">확인</button>
</div>
<div class="lgoin_bottom clearfix">
<div>
<div class="checkbox_wrap">
@ -367,4 +641,10 @@ function fn_click_banner_add_stat(bannerMenuCode){
</div>
<!--// 마이페이지 - 회원정보 변경 -->
</form:form>
<form name="checkForm" id="checkForm" method="post" action="#">
<input type="hidden" name="searchNm" value=""/>
<input type="hidden" name="userId" value=""/>
<input type="hidden" name="callTo" value=""/>
<input type="hidden" name="receive" value=""/>
</form>
</div>