Merge branch 'tolag3'
This commit is contained in:
commit
f4ad53112c
@ -2,6 +2,8 @@ package kcc.kccadr.adjPgrMgr.dlvinfo.service;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
public interface DlvinfoService {
|
public interface DlvinfoService {
|
||||||
|
|
||||||
List<DlvinfoVO> selectAdjustDeliveryInfoList(DlvinfoVO dlvinfoVO) throws Exception;
|
List<DlvinfoVO> selectAdjustDeliveryInfoList(DlvinfoVO dlvinfoVO) throws Exception;
|
||||||
@ -24,7 +26,7 @@ public interface DlvinfoService {
|
|||||||
|
|
||||||
DlvinfoVO selectAdjustDeliveryLatestInfo(DlvinfoVO dlvinfoVO) throws Exception;
|
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;
|
int updateAdjustDeliverySocialInfo(DlvinfoDetailVO dlvinfoDetailVO) throws Exception;
|
||||||
|
|
||||||
|
|||||||
@ -3,6 +3,7 @@ package kcc.kccadr.adjPgrMgr.dlvinfo.service.impl;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@ -126,12 +127,20 @@ public class DlvinfoServiceImpl implements DlvinfoService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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()) {
|
for(String target : dlvinfoDetailVO.getRpplSeqs()) {
|
||||||
dlvinfoDetailVO.setRpplSeq(target);
|
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);
|
dlvinfoDAO.insertAdjustDeliverySocialInfo(dlvinfoDetailVO);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import java.util.List;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
import org.apache.commons.lang.time.DateFormatUtils;
|
import org.apache.commons.lang.time.DateFormatUtils;
|
||||||
import org.apache.commons.lang.time.DateUtils;
|
import org.apache.commons.lang.time.DateUtils;
|
||||||
@ -421,7 +422,11 @@ public class DlvinfoController {
|
|||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@RequestMapping("dlvinfoUrlInsertAjax.do")
|
@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;
|
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated() ? (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser() : null;
|
||||||
@ -434,7 +439,7 @@ public class DlvinfoController {
|
|||||||
modelAndView.setViewName("jsonView");
|
modelAndView.setViewName("jsonView");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
dlvinfoService.insertAdjustDeliverySocialInfo(dlvinfoDetailVO);
|
dlvinfoService.insertAdjustDeliverySocialInfo(dlvinfoDetailVO, request);
|
||||||
modelAndView.addObject("result", "success");
|
modelAndView.addObject("result", "success");
|
||||||
}catch (Exception e) {
|
}catch (Exception e) {
|
||||||
modelAndView.addObject("message", "다시 시도 부탁드립니다.");
|
modelAndView.addObject("message", "다시 시도 부탁드립니다.");
|
||||||
|
|||||||
@ -125,7 +125,7 @@ public class CertDocController {
|
|||||||
|
|
||||||
rpplVO = adjRpplService.selectAdjRpplDetail(rpplVO);
|
rpplVO = adjRpplService.selectAdjRpplDetail(rpplVO);
|
||||||
|
|
||||||
String encEmail = egovCryptoUtil.encrypt(dlvinfoVO.getEmail());
|
String encEmail = egovCryptoUtil.encrypt(dlvinfoVO.getEmail()).trim();
|
||||||
|
|
||||||
String returnUrl = "";
|
String returnUrl = "";
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ public class CertDocController {
|
|||||||
|
|
||||||
if(!encEmail.equals(rpplVO.getRpplEmail())){
|
if(!encEmail.equals(rpplVO.getRpplEmail())){
|
||||||
rs.addFlashAttribute("returnMsg", "신청정보(이메일)가 일치하지 않습니다.");
|
rs.addFlashAttribute("returnMsg", "신청정보(이메일)가 일치하지 않습니다.");
|
||||||
|
rs.addFlashAttribute("logout", "Y");
|
||||||
returnUrl = dlvinfoVO.getUrl();
|
returnUrl = dlvinfoVO.getUrl();
|
||||||
|
|
||||||
return "redirect:" + returnUrl;
|
return "redirect:" + returnUrl;
|
||||||
|
|||||||
@ -57,7 +57,7 @@ public class EgovCryptoUtil {
|
|||||||
//System.out.println(cryptoService.getCyptoAlgorithmKey());
|
//System.out.println(cryptoService.getCyptoAlgorithmKey());
|
||||||
//System.out.println(cryptoService.getCyptoAlgorithmKey());
|
//System.out.println(cryptoService.getCyptoAlgorithmKey());
|
||||||
//return cryptoService.encrypt(encrypt); // Handles URLEncoding.
|
//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) {
|
} catch(IllegalArgumentException e) {
|
||||||
LOGGER.error("[IllegalArgumentException] Try/Catch...usingParameters Runing : "+ e.getMessage());
|
LOGGER.error("[IllegalArgumentException] Try/Catch...usingParameters Runing : "+ e.getMessage());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@ -30,8 +30,8 @@
|
|||||||
<p class="login_tit"><span>로그인</span>해주세요</p>
|
<p class="login_tit"><span>로그인</span>해주세요</p>
|
||||||
<div class="login_form">
|
<div class="login_form">
|
||||||
<div class="btn_wrap">
|
<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 id="naverIdLogin" style="display:none;"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -56,7 +56,10 @@ $(document).ready(function() {
|
|||||||
alert("<c:out value='${returnMsg}' />");
|
alert("<c:out value='${returnMsg}' />");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var logoutYn = "<c:out value='${logout}' />";
|
||||||
|
if(logoutYn == 'Y'){
|
||||||
|
kakaoLogout();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
$(document).on("click", "#naverLogin", function(){
|
$(document).on("click", "#naverLogin", function(){
|
||||||
var btnNaverLogin = document.getElementById("naverIdLogin").firstChild;
|
var btnNaverLogin = document.getElementById("naverIdLogin").firstChild;
|
||||||
@ -117,4 +120,25 @@ $(document).on("click", "#naverLogin", function(){
|
|||||||
snsLoginForm.submit();
|
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>
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user