로그인 수정(시군구코드+유저아이디+패스워드)

main
이범준 5 months ago
parent 5b21460512
commit 677957eb8b

@ -32,8 +32,8 @@ public class MainController extends cokr.xit.base.web.MainController {
@Override @Override
public ModelAndView loginPage() { public ModelAndView loginPage() {
ModelAndView mav = new ModelAndView("login"); ModelAndView mav = new ModelAndView("login");
List<DataObject> instList = fimsOgdpBean.selectAllInstList(); List<DataObject> sggList = fimsOgdpBean.selectAllSggList();
mav.addObject("instList", instList); mav.addObject("sggList", sggList);
return mav; return mav;
} }

@ -109,7 +109,8 @@ SELECT *
<where> <where>
<if test="userID != null">AND USER_ID = #{userID}</if> <if test="userID != null">AND USER_ID = #{userID}</if>
<if test="account != null">AND USER_ACNT = #{account}</if> <if test="account != null">AND USER_ACNT = #{account}</if>
<if test="institute != null"> AND NSTT_CD = #{institute}</if> <if test="institute != null">AND NSTT_CD = #{institute}</if>
<if test="orgID != null">AND ORG_ID = #{orgID}</if>
</where> </where>
</select> </select>

@ -54,13 +54,13 @@
<form id="formAuthentication" method="post"> <form id="formAuthentication" method="post">
<div class="input_wrap"> <div class="input_wrap">
<div class="input-group"> <div class="input-group">
<select id="institute" name="institute" required title="기관명" class="form-select mb-2 h-px-40 no-max-w"> <select id="orgID" name="orgID" required title="시군구명" class="form-select mb-2 h-px-40 no-max-w">
<option value="">[기관 선택]</option> <option value="">[기관 선택]</option>
<option value="default">시스템관리</option> <option value="default">시스템관리</option>
<c:forEach items="${instList}" var="item"> <c:forEach items="${sggList}" var="item">
<option value="${item.INST_CD}" <option value="${item.SGG_CD}"
<c:if test="${item.USER_USE_YN == 'N'}"> disabled </c:if> <c:if test="${item.USER_USE_YN == 'N'}"> disabled </c:if>
>${item.INST_NM}</option> >${item.SGG_NM}</option>
</c:forEach> </c:forEach>
</select> </select>
</div> </div>
@ -98,8 +98,8 @@
<template id="selectInstDialogTemplate"> <template id="selectInstDialogTemplate">
<select class="form-select form-control-sm" id="selectInst"> <select class="form-select form-control-sm" id="selectInst">
<option value="">선택</option> <option value="">선택</option>
<c:forEach items="${instList}" var="item"> <c:forEach items="${sggList}" var="item">
<option value="${item.INST_CD}">${item.INST_NM}</option> <option value="${item.SGG_CD}">${item.SGG_NM}</option>
</c:forEach> </c:forEach>
</select> </select>
</template> </template>
@ -116,7 +116,7 @@ function login() {
var params = { var params = {
account:$("#userId").val(), account:$("#userId").val(),
password:$("#password").val(), password:$("#password").val(),
institute:$("#institute").val(), orgID: $("#orgID").val(),
rememberCredentials: $("#remember").prop("checked") rememberCredentials: $("#remember").prop("checked")
}; };
@ -214,7 +214,7 @@ $(function(){
$("#formAuthentication input").onEnterPress(login); $("#formAuthentication input").onEnterPress(login);
let sysInst = "<%= systemInst %>"; let sysInst = "<%= systemInst %>";
let cookieInst = "${cookie['userInstitute'].getValue()}"; let cookieOrg = "${cookie['userInstitute'].getValue()}";
let cookieUserId = "${cookie['userAccount'].getValue()}"; let cookieUserId = "${cookie['userAccount'].getValue()}";
let hasCookie = (cookieInst != "" && cookieUserId != ""); let hasCookie = (cookieInst != "" && cookieUserId != "");
let selectValue = ""; let selectValue = "";
@ -222,9 +222,9 @@ $(function(){
if(hasCookie){ if(hasCookie){
selectValue = cookieInst; selectValue = cookieInst;
isSelectable = $("#institute option[value='"+selectValue+"']").not("[disabled]").length; isSelectable = $("#orgID option[value='"+selectValue+"']").not("[disabled]").length;
if(isSelectable){ if(isSelectable){
$("#institute").val(cookieInst); $("#orgID").val(cookieOrg);
$("#userId").val(cookieUserId); $("#userId").val(cookieUserId);
$("#remember").prop("checked", true); $("#remember").prop("checked", true);
$("#password").focus(); $("#password").focus();
@ -235,10 +235,10 @@ $(function(){
selectValue = sysInst; selectValue = sysInst;
isSelectable = $("#institute option[value='"+selectValue+"']").not("[disabled]").length; isSelectable = $("#institute option[value='"+selectValue+"']").not("[disabled]").length;
if(isSelectable){ if(isSelectable){
$("#institute").val(selectValue); $("#orgID").val(selectValue);
$("#userId").focus(); $("#userId").focus();
} else { } else {
$("#institute").focus(); $("#orgID").focus();
} }
}); });

Loading…
Cancel
Save