diff --git a/src/main/java/itn/let/uat/uia/web/EgovLoginController.java b/src/main/java/itn/let/uat/uia/web/EgovLoginController.java index 87b3d301..eed122fa 100644 --- a/src/main/java/itn/let/uat/uia/web/EgovLoginController.java +++ b/src/main/java/itn/let/uat/uia/web/EgovLoginController.java @@ -1074,12 +1074,21 @@ public class EgovLoginController { String message = (String) commandMap.get("message"); String goEventPay = (String) commandMap.get("goEventPay"); - // sns 회원가입 key 값 설정 - String naverClientId = itnNaverClientId; - String naverClientSecret = itnNaverClientSecret; + /* + * 헤더에서 id/pw는 맞지만 보안로그인 설정 되어있을때 -> secure + * + */ - String kakaoRestApiKey = itnKakaoRestApiKey; - String kakaoReturnUrl = itnKakaoReturnUrl; + String headerLoginResult = (String) commandMap.get("headerLoginResult"); + String id = (String) commandMap.get("id"); + String pw = (String) commandMap.get("password"); + + // sns 회원가입 key 값 설정 +// String naverClientId = itnNaverClientId; +// String naverClientSecret = itnNaverClientSecret; +// +// String kakaoRestApiKey = itnKakaoRestApiKey; +// String kakaoReturnUrl = itnKakaoReturnUrl; // config 정보 가져오기 MberManageConfigVO mberConfigVO = new MberManageConfigVO(); @@ -1129,6 +1138,16 @@ public class EgovLoginController { model.addAttribute("userIp", userIp); model.addAttribute("goEventPay", goEventPay); + + + if(StringUtil.isNotEmpty(headerLoginResult)) { + model.addAttribute("id_secure", id); + model.addAttribute("pw_secure", pw); + }else { + headerLoginResult = "N"; + } + + model.addAttribute("headerLoginResult", headerLoginResult); return "web/login/EgovLoginGnrlUsr"; } @@ -1833,6 +1852,8 @@ public class EgovLoginController { HttpServletRequest request, @RequestParam Map commandMap, ModelMap model, HttpSession session, RedirectAttributes redirectAttributes) throws Exception { + + ModelAndView modelAndView = new ModelAndView(); modelAndView.setViewName("jsonView"); diff --git a/src/main/webapp/WEB-INF/jsp/web/com/webCommonHeader.jsp b/src/main/webapp/WEB-INF/jsp/web/com/webCommonHeader.jsp index fc77da82..7231f629 100644 --- a/src/main/webapp/WEB-INF/jsp/web/com/webCommonHeader.jsp +++ b/src/main/webapp/WEB-INF/jsp/web/com/webCommonHeader.jsp @@ -341,8 +341,8 @@ function whoisIpCountry() { } function actionLogin() { - location.href=""; - /* +// location.href=""; + // 아이디 공백 제거 document.loginForm.id_text.value = $.trim(document.loginForm.id_text.value); @@ -353,16 +353,6 @@ function actionLogin() { alert("비밀번호를 입력하세요"); return; } else { - - // Whois IP 국가코드 - //whoisIpCountry(); - setTimeout(function() { - if (isKoreaIpAddress == false) { - alert("해외 IP로 감지되어 로그인이 제한되었습니다.\n문자온 고객센터로 문의 바랍니다."); - location.href='/web/uat/uia/actionLogout.do'; - return false; - } - // 로그인 START var rsa = new RSAKey(); rsa.setPublic($('#RSAModulus').val(),$('#RSAExponent').val()); @@ -373,13 +363,84 @@ function actionLogin() { $("#id").val(rsa.encrypt(id.val().toLowerCase())); $("#password").val(rsa.encrypt(pw.val())); - document.loginForm.action=""; saveid(document.loginForm); - document.loginForm.submit(); - }, 600); - + + var checkForm = $("form[name=loginForm]").serialize() ; + + $.ajax({ + type : "POST", + async : false, + url : "/web/user/login/actionSecurityLoginBeforeHpAjax.do", + data : checkForm, + dataType:'json', + success : function(data) { + if (data.status=="success"){ + + document.loginForm.passFlag.value = data.passFlag; + if(data.passFlag == "Y") + { + actionLogin_end(); + } + else + { + goLoginPage(id.val(), pw.val(), "secure"); + } + }else if (data.status=="fail"){ + + if (data.returnType == "A"){ + //휴면 회원 + document.loginForm.action=""; + document.loginForm.submit(); + }else if (data.returnType == "B"){ + //기업회원 기업정보 기입 + document.cmpChangeForm.mberId.value = data.mberId; + document.cmpChangeForm.action=""; + document.cmpChangeForm.submit(); + }else if (data.returnType == "C"){ + document.cmpChangeForm.mberId.value = data.mberId; + document.cmpChangeForm.action=""; + document.cmpChangeForm.submit(); + }else{ + //로그인 실패 page이동 + goLoginPage(id.val(), pw.val(), 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; + } + }); } - */ + +} + +function goLoginPage(id, pw, headerLoginResult){ + document.loginForm.id.value = id; + document.loginForm.password.value = pw; + document.loginForm.headerLoginResult.value = headerLoginResult; + document.loginForm.action = ""; + + document.loginForm.submit(); +} + +//아이디/휴대폰 번호 체크 +function actionLogin_end(){ + document.loginForm.action=""; + saveid(document.loginForm); + document.loginForm.submit(); } function saveid(form) { @@ -1636,14 +1697,19 @@ function actionLogin() { + + +