This commit is contained in:
myname 2023-09-12 15:58:12 +09:00
commit b07606e95e
8 changed files with 120 additions and 4 deletions

View File

@ -121,6 +121,7 @@ public class LoginVO implements Serializable{
private String key;
private String user_id;
private String returnUrl;
private String mberSeq;
public String getId() {
return id;
@ -425,6 +426,13 @@ public class LoginVO implements Serializable{
public void setReturnUrl(String returnUrl) {
this.returnUrl = returnUrl;
}
public String getMberSeq() {
return mberSeq;
}
public void setMberSeq(String mberSeq) {
this.mberSeq = mberSeq;
}
}

View File

@ -92,4 +92,6 @@ public interface EgovLoginService {
LoginVO APIActionLogin(LoginVO vo) throws Exception;
LoginVO selectOffeduMberChk(LoginVO vo) throws Exception;
void updateMberSeqKeyAjax(LoginVO vo) throws Exception;
}

View File

@ -281,4 +281,9 @@ public class EgovLoginServiceImpl extends EgovAbstractServiceImpl implements
public LoginVO selectOffeduMberChk(LoginVO vo) throws Exception {
return loginDAO.selectOffeduMberChk(vo);
}
@Override
public void updateMberSeqKeyAjax(LoginVO vo) throws Exception {
loginDAO.updateMberSeqKeyAjax(vo);
}
}

View File

@ -135,4 +135,9 @@ public class LoginDAO extends EgovAbstractDAO {
public LoginVO selectOffeduMberChk(LoginVO vo) throws Exception {
return (LoginVO)select("loginDAO.selectOffeduMberChk", vo);
}
public void updateMberSeqKeyAjax(LoginVO vo) throws Exception{
update("loginDAO.updateMberSeqKeyAjax", vo);
}
}

View File

@ -4,6 +4,8 @@ import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.Map;
@ -23,9 +25,12 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.context.support.WebApplicationContextUtils;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
import kcc.com.cmm.LoginVO;
import kcc.com.utl.fcc.service.EgovStringUtil;
import kcc.let.uat.uia.service.EgovLoginService;
import kcc.let.uss.umt.service.EgovUserManageService;
import kcc.let.uss.umt.service.UserManageVO;
@ -67,7 +72,7 @@ public class APILoginContoller {
//테스트를 위한 선언
userId = "std02@forwiz.com";
key = "std02@forwiz.com1106490137E234AF19E376481D60C0A7";
key = "std02@forwiz.comnPPp8JU56YuznXtm91YlcItGzg52zxNVax6aS6OrsaWZzSV6xPnMKnL0OOUbJzkg.amV1c19kb21haW4vTE1T";
returnUrl = "/web/main/mainPage.do";
if(userId == null || key == null) {
@ -223,4 +228,43 @@ public class APILoginContoller {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(response);
}
}
}
/**
* @methodName : updateMberSeqKey
* @description : 찾교 회원 seq 생성
* @param adrInnorixFileVO
* @return
* @throws Exception
*/
@RequestMapping(value = "/web/updateMberSeqKeyAjax.do")
public ModelAndView updateMberSeqKeyAjax() 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(loginVO == null) { // 로그인 상태 파라미터 없이 e-배움터로 이동
modelAndView.addObject("status", "loginN");
return modelAndView;
}else {
//로그인 상태 seq 업데이트와 파라미터 전달
try {
LocalDateTime now = LocalDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSS");
String key = now.format(formatter);
loginVO.setMberSeq(key);
loginService.updateMberSeqKeyAjax(loginVO);
modelAndView.addObject("status", "loginY");
modelAndView.addObject("user_id", userId);
modelAndView.addObject("key", key);
return modelAndView;
}catch(Exception e) {
modelAndView.addObject("status", "fail");
return modelAndView;
}
}
}
}

View File

@ -27,7 +27,7 @@ Globals.Password= edusce#23
Globals.DriverClassName=com.tmax.tibero.jdbc.TbDriver
#\uac1c\ubc1c DB \uc11c\ubc84
Globals.Url=jdbc:tibero:thin:@172.17.0.55:8629:copydb
Globals.Url=jdbc:tibero:thin:@172.17.0.10:8629:copydb
# \uc800\uc791\uc704 \ubb38\uc790\uc804\uc1a1 DB(\uac1c\ubc1c)

View File

@ -429,4 +429,11 @@
WHERE mber_id = #user_id#
AND ESNTL_ID = #key#
</select>
<update id="loginDAO.updateMberSeqKeyAjax" parameterClass="loginVO">
/* 임시.*NOT_SQL_LOG.* loginDAO.updateMberSeqKeyAjax*/
UPDATE LETTNGNRLMBER
SET mber_seq = #mberSeq#
WHERE mber_id = #id#
</update>
</sqlMap>

View File

@ -120,6 +120,31 @@ function usrJoin(){
function zooms() {
document.body.style.zoom = nowZoom + "%";
}
function goEEdu() {
$.ajax({
url : "<c:url value='/web/updateMberSeqKeyAjax.do'/>",
async:false,
processData: false,
contentType: false,
cache: false,
success: function (returnData, status) {
if(returnData.status == 'loginY'){
alert(returnData.user_id);
alert(returnData.key);
window.location.href = "http://223.255.205.7/user/main/main.do?user_id="+returnData.user_id+"&key="+returnData.key;
} else if(returnData.status == 'fail') {
alert("key 갱신 오류");
}
},
error: function (e) {
console.log("ERROR : ", e);
alert("key 갱신 오류");
}
});
}
</script>
</head>
@ -147,6 +172,16 @@ function usrJoin(){
<img src="${pageContext.request.contextPath}/visitEdu/usr/publish/images/common/kcc_ci.png" alt="한국저작권위원회">
<span>GO</span>
</button>
<button class="site" onclick="window.location.href='http://223.255.205.7/user/main/main.do'" title="새창열림">
<img src="${pageContext.request.contextPath}/visitEdu/usr/publish/images/common/kcc_ci.png" alt="한국저작권위원회">
<span>e-배움터GO(비로그인)</span>
</button>
<button class="site" onclick="javascript:goEEdu();" title="새창열림">
<img src="${pageContext.request.contextPath}/visitEdu/usr/publish/images/common/kcc_ci.png" alt="한국저작권위원회">
<span>e-배움터GO(로그인)</span>
</button>
<div class="area_right">
<!-- local -->
<c:if test="${environment eq 'local' }">
@ -185,6 +220,16 @@ function usrJoin(){
<img src="${pageContext.request.contextPath}/visitEdu/usr/publish/images/common/kcc_ci.png" alt="한국저작권위원회">
<span>GO</span>
</button>
<button class="site" onclick="window.location.href='http://223.255.205.7/user/main/main.do" title="새창열림">
<img src="${pageContext.request.contextPath}/visitEdu/usr/publish/images/common/kcc_ci.png" alt="한국저작권위원회">
<span>e-배움터GO(비로그인)</span>
</button>
<button class="site" onclick="javascript:goEEdu();" title="새창열림">
<img src="${pageContext.request.contextPath}/visitEdu/usr/publish/images/common/kcc_ci.png" alt="한국저작권위원회">
<span>e-배움터GO(로그인)</span>
</button>
<div class="area_right">
<!-- Sso 연계 테스트 로그인 후-->
<p class="login_after"><c:out value="${ssoLoginVO.membName}"/><span>님</span></p>