허용IP등록
This commit is contained in:
parent
9b3a4a3362
commit
3dceedeabc
@ -3,6 +3,7 @@ package itn.let.cert.ip.web;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@ -17,6 +18,7 @@ import itn.com.utl.fcc.service.EgovStringUtil;
|
||||
import itn.let.cert.ip.service.CertIpService;
|
||||
import itn.let.cert.ip.service.MberCertIpVO;
|
||||
import itn.let.mail.service.StatusResponse;
|
||||
import itn.let.utl.sim.service.EgovClntInfo;
|
||||
|
||||
/**
|
||||
*
|
||||
@ -79,6 +81,29 @@ public class CertIpController {
|
||||
return ResponseEntity.ok().body(certIpService.insertCertIp(mberCertIpVO));
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = {"/cert/ip/insertCennetCertIp.do"})
|
||||
public ResponseEntity<StatusResponse> insertCennetCertIp(MberCertIpVO mberCertIpVO,HttpServletRequest request) throws Exception {
|
||||
|
||||
ModelAndView modelAndView = new ModelAndView();
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
//로그인 권한정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getId());
|
||||
|
||||
if(userId == null) {
|
||||
if(StringUtils.isEmpty(userId)) return ResponseEntity.ok().body(new StatusResponse(HttpStatus.BAD_REQUEST, "로그인 후 이용해 주세요", LocalDateTime.now()));
|
||||
}
|
||||
mberCertIpVO.setFrstRegisterId(userId);
|
||||
mberCertIpVO.setMberId(userId);
|
||||
|
||||
mberCertIpVO.setCertIp(EgovClntInfo.getClntIP(request));
|
||||
mberCertIpVO.setCertMemo("허용 IP 등록");
|
||||
|
||||
return ResponseEntity.ok().body(certIpService.insertCertIp(mberCertIpVO));
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/cert/ip/deleteCertIp.do"})
|
||||
public ResponseEntity<StatusResponse> deleteCertIp(MberCertIpVO mberCertIpVO) throws Exception {
|
||||
|
||||
|
||||
@ -13,7 +13,26 @@ $(document).ready(function(){
|
||||
// 허용 IP 등록
|
||||
$(".btn_allow_ip_add").click(function () {
|
||||
if (confirm("현재 접속중인 IP를 접속 허용 IP로 등록하시겠습니까?")) {
|
||||
alert("접속 허용 IP 등록이 완료되었습니다.");
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/cert/ip/insertCennetCertIp.do",
|
||||
data: null,
|
||||
dataType:'json',
|
||||
async: false,
|
||||
success: function (returnData) {
|
||||
if(returnData.status == 'OK'){
|
||||
alert("접속 허용 IP 등록이 완료되었습니다.");
|
||||
location.reload();
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("오류가 발생하였습니다.");
|
||||
}
|
||||
},
|
||||
error: function (e) { alert("오류가 발생하였습니다."); console.log("ERROR : ", e); }
|
||||
});
|
||||
|
||||
} else {}
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user