이준호 전자조정시스템 고도화 커밋
- (사용자) 송달서류 소셜로그인으로 확인 수정
This commit is contained in:
parent
8b25def751
commit
7a0fac1f97
@ -2,6 +2,8 @@ package kcc.kccadr.adjPgrMgr.dlvinfo.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public interface DlvinfoService {
|
||||
|
||||
List<DlvinfoVO> selectAdjustDeliveryInfoList(DlvinfoVO dlvinfoVO) throws Exception;
|
||||
@ -24,7 +26,7 @@ public interface DlvinfoService {
|
||||
|
||||
DlvinfoVO selectAdjustDeliveryLatestInfo(DlvinfoVO dlvinfoVO) throws Exception;
|
||||
|
||||
public void insertAdjustDeliverySocialInfo(DlvinfoDetailVO dlvinfoDetailVO) throws Exception;
|
||||
public void insertAdjustDeliverySocialInfo(DlvinfoDetailVO dlvinfoDetailVO, HttpServletRequest request) throws Exception;
|
||||
|
||||
int updateAdjustDeliverySocialInfo(DlvinfoDetailVO dlvinfoDetailVO) throws Exception;
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ package kcc.kccadr.adjPgrMgr.dlvinfo.service.impl;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@ -126,12 +127,20 @@ public class DlvinfoServiceImpl implements DlvinfoService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertAdjustDeliverySocialInfo(DlvinfoDetailVO dlvinfoDetailVO) throws Exception {
|
||||
public void insertAdjustDeliverySocialInfo(DlvinfoDetailVO dlvinfoDetailVO, HttpServletRequest request) throws Exception {
|
||||
String serverNm = request.getServerName();
|
||||
String serverPort = String.valueOf(request.getServerPort());
|
||||
String serverScheme = request.getScheme();
|
||||
if("80".equals(serverPort)) {
|
||||
serverPort = "";
|
||||
}else {
|
||||
serverPort = ":" + serverPort;
|
||||
}
|
||||
|
||||
for(String target : dlvinfoDetailVO.getRpplSeqs()) {
|
||||
dlvinfoDetailVO.setRpplSeq(target);
|
||||
|
||||
dlvinfoDetailVO.setUrl("http://localhost:8089/web/kccadr/certDoc/snsLoginPage.do?rpplSeq="+dlvinfoDetailVO.getRpplSeq()+"&dlvrySeq="+dlvinfoDetailVO.getDlvrySeq());
|
||||
dlvinfoDetailVO.setUrl(serverScheme + "://" + serverNm + serverPort + "/web/kccadr/certDoc/snsLoginPage.do?rpplSeq="+dlvinfoDetailVO.getRpplSeq()+"&dlvrySeq="+dlvinfoDetailVO.getDlvrySeq());
|
||||
|
||||
dlvinfoDAO.insertAdjustDeliverySocialInfo(dlvinfoDetailVO);
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang.time.DateFormatUtils;
|
||||
import org.apache.commons.lang.time.DateUtils;
|
||||
@ -421,7 +422,11 @@ public class DlvinfoController {
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("dlvinfoUrlInsertAjax.do")
|
||||
public ModelAndView dlvinfoUrlInsertAjax(@ModelAttribute("dlvinfoDetailVO") DlvinfoDetailVO dlvinfoDetailVO, ModelMap model, RedirectAttributes redirectAttributes, final MultipartHttpServletRequest multiRequest) throws Exception {
|
||||
public ModelAndView dlvinfoUrlInsertAjax(@ModelAttribute("dlvinfoDetailVO") DlvinfoDetailVO dlvinfoDetailVO
|
||||
, ModelMap model
|
||||
, RedirectAttributes redirectAttributes
|
||||
, final MultipartHttpServletRequest multiRequest
|
||||
, HttpServletRequest request) throws Exception {
|
||||
|
||||
// 로그인 정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated() ? (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser() : null;
|
||||
@ -434,7 +439,7 @@ public class DlvinfoController {
|
||||
modelAndView.setViewName("jsonView");
|
||||
|
||||
try {
|
||||
dlvinfoService.insertAdjustDeliverySocialInfo(dlvinfoDetailVO);
|
||||
dlvinfoService.insertAdjustDeliverySocialInfo(dlvinfoDetailVO, request);
|
||||
modelAndView.addObject("result", "success");
|
||||
}catch (Exception e) {
|
||||
modelAndView.addObject("message", "다시 시도 부탁드립니다.");
|
||||
|
||||
@ -125,7 +125,7 @@ public class CertDocController {
|
||||
|
||||
rpplVO = adjRpplService.selectAdjRpplDetail(rpplVO);
|
||||
|
||||
String encEmail = egovCryptoUtil.encrypt(dlvinfoVO.getEmail());
|
||||
String encEmail = egovCryptoUtil.encrypt(dlvinfoVO.getEmail()).trim();
|
||||
|
||||
String returnUrl = "";
|
||||
|
||||
@ -134,7 +134,7 @@ public class CertDocController {
|
||||
|
||||
if(!encEmail.equals(rpplVO.getRpplEmail())){
|
||||
rs.addFlashAttribute("returnMsg", "신청정보(이메일)가 일치하지 않습니다.");
|
||||
|
||||
rs.addFlashAttribute("logout", "Y");
|
||||
returnUrl = dlvinfoVO.getUrl();
|
||||
|
||||
return "redirect:" + returnUrl;
|
||||
|
||||
@ -57,7 +57,7 @@ public class EgovCryptoUtil {
|
||||
//System.out.println(cryptoService.getCyptoAlgorithmKey());
|
||||
//System.out.println(cryptoService.getCyptoAlgorithmKey());
|
||||
//return cryptoService.encrypt(encrypt); // Handles URLEncoding.
|
||||
return cryptoService.encryptNone(encrypt); // Does not handle URLEncoding.
|
||||
return cryptoService.encryptNone(encrypt).trim(); // Does not handle URLEncoding.
|
||||
} catch(IllegalArgumentException e) {
|
||||
LOGGER.error("[IllegalArgumentException] Try/Catch...usingParameters Runing : "+ e.getMessage());
|
||||
} catch (Exception e) {
|
||||
|
||||
@ -30,8 +30,8 @@
|
||||
<p class="login_tit"><span>로그인</span>해주세요</p>
|
||||
<div class="login_form">
|
||||
<div class="btn_wrap">
|
||||
<button type="button" onclick="javascript:kakaoLogin();" class="btn_kakao">카카오로 로그인</button>
|
||||
<button type="button" id="naverLogin" class="btn_naver">네이버로 로그인</button>
|
||||
<button type="button" id="naverLogin" class="btn_naver">네이버 로그인</button>
|
||||
<button type="button" onclick="javascript:kakaoLogin();" class="btn_kakao">카카오 로그인</button>
|
||||
<div id="naverIdLogin" style="display:none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -56,7 +56,10 @@ $(document).ready(function() {
|
||||
alert("<c:out value='${returnMsg}' />");
|
||||
}
|
||||
|
||||
|
||||
var logoutYn = "<c:out value='${logout}' />";
|
||||
if(logoutYn == 'Y'){
|
||||
kakaoLogout();
|
||||
}
|
||||
});
|
||||
$(document).on("click", "#naverLogin", function(){
|
||||
var btnNaverLogin = document.getElementById("naverIdLogin").firstChild;
|
||||
@ -117,4 +120,25 @@ $(document).on("click", "#naverLogin", function(){
|
||||
snsLoginForm.submit();
|
||||
|
||||
}
|
||||
|
||||
function kakaoLogout() {
|
||||
if (Kakao.Auth.getAccessToken()) {
|
||||
//토큰이 있으면
|
||||
Kakao.API.request({
|
||||
//로그아웃하고
|
||||
url: '/v1/user/unlink',
|
||||
success: function (response) {
|
||||
//console.log(response)
|
||||
},
|
||||
fail: function (error) {
|
||||
console.log(error)
|
||||
},
|
||||
})
|
||||
//토큰도 삭제
|
||||
Kakao.Auth.setAccessToken(undefined)
|
||||
//유저정보도 삭제
|
||||
const userinfoElem = document.querySelector('#userinfo')
|
||||
if(userinfoElem) userinfoElem.value = ''
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user