--- src/main/java/itn/let/cert/ip/web/CertIpController.java
+++ src/main/java/itn/let/cert/ip/web/CertIpController.java
... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 |
import java.time.LocalDateTime; |
| 4 | 4 |
|
| 5 | 5 |
import javax.annotation.Resource; |
| 6 |
+import javax.servlet.http.HttpServletRequest; |
|
| 6 | 7 |
|
| 7 | 8 |
import org.apache.commons.lang3.StringUtils; |
| 8 | 9 |
import org.springframework.http.HttpStatus; |
... | ... | @@ -17,6 +18,7 @@ |
| 17 | 18 |
import itn.let.cert.ip.service.CertIpService; |
| 18 | 19 |
import itn.let.cert.ip.service.MberCertIpVO; |
| 19 | 20 |
import itn.let.mail.service.StatusResponse; |
| 21 |
+import itn.let.utl.sim.service.EgovClntInfo; |
|
| 20 | 22 |
|
| 21 | 23 |
/** |
| 22 | 24 |
* |
... | ... | @@ -79,6 +81,29 @@ |
| 79 | 81 |
return ResponseEntity.ok().body(certIpService.insertCertIp(mberCertIpVO)); |
| 80 | 82 |
} |
| 81 | 83 |
|
| 84 |
+ |
|
| 85 |
+ @RequestMapping(value = {"/cert/ip/insertCennetCertIp.do"})
|
|
| 86 |
+ public ResponseEntity<StatusResponse> insertCennetCertIp(MberCertIpVO mberCertIpVO,HttpServletRequest request) throws Exception {
|
|
| 87 |
+ |
|
| 88 |
+ ModelAndView modelAndView = new ModelAndView(); |
|
| 89 |
+ modelAndView.setViewName("jsonView");
|
|
| 90 |
+ |
|
| 91 |
+ //로그인 권한정보 불러오기 |
|
| 92 |
+ LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null; |
|
| 93 |
+ String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId()); |
|
| 94 |
+ |
|
| 95 |
+ if(userId == null) {
|
|
| 96 |
+ if(StringUtils.isEmpty(userId)) return ResponseEntity.ok().body(new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용해 주세요", LocalDateTime.now())); |
|
| 97 |
+ } |
|
| 98 |
+ mberCertIpVO.setFrstRegisterId(userId); |
|
| 99 |
+ mberCertIpVO.setMberId(userId); |
|
| 100 |
+ |
|
| 101 |
+ mberCertIpVO.setCertIp(EgovClntInfo.getClntIP(request)); |
|
| 102 |
+ mberCertIpVO.setCertMemo("허용 IP 등록");
|
|
| 103 |
+ |
|
| 104 |
+ return ResponseEntity.ok().body(certIpService.insertCertIp(mberCertIpVO)); |
|
| 105 |
+ } |
|
| 106 |
+ |
|
| 82 | 107 |
@RequestMapping(value = {"/cert/ip/deleteCertIp.do"})
|
| 83 | 108 |
public ResponseEntity<StatusResponse> deleteCertIp(MberCertIpVO mberCertIpVO) throws Exception {
|
| 84 | 109 |
|
--- src/main/webapp/WEB-INF/jsp/web/user/mberSecureLogin.jsp
+++ src/main/webapp/WEB-INF/jsp/web/user/mberSecureLogin.jsp
... | ... | @@ -13,7 +13,26 @@ |
| 13 | 13 |
// 허용 IP 등록 |
| 14 | 14 |
$(".btn_allow_ip_add").click(function () {
|
| 15 | 15 |
if (confirm("현재 접속중인 IP를 접속 허용 IP로 등록하시겠습니까?")) {
|
| 16 |
- alert("접속 허용 IP 등록이 완료되었습니다.");
|
|
| 16 |
+ |
|
| 17 |
+ $.ajax({
|
|
| 18 |
+ type: "POST", |
|
| 19 |
+ url: "/cert/ip/insertCennetCertIp.do", |
|
| 20 |
+ data: null, |
|
| 21 |
+ dataType:'json', |
|
| 22 |
+ async: false, |
|
| 23 |
+ success: function (returnData) {
|
|
| 24 |
+ if(returnData.status == 'OK'){
|
|
| 25 |
+ alert("접속 허용 IP 등록이 완료되었습니다.");
|
|
| 26 |
+ location.reload(); |
|
| 27 |
+ } |
|
| 28 |
+ else |
|
| 29 |
+ {
|
|
| 30 |
+ alert("오류가 발생하였습니다.");
|
|
| 31 |
+ } |
|
| 32 |
+ }, |
|
| 33 |
+ error: function (e) { alert("오류가 발생하였습니다."); console.log("ERROR : ", e); }
|
|
| 34 |
+ }); |
|
| 35 |
+ |
|
| 17 | 36 |
} else {}
|
| 18 | 37 |
}); |
| 19 | 38 |
|
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?