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

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

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

@ -109,7 +109,8 @@ SELECT *
<where>
<if test="userID != null">AND USER_ID = #{userID}</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>
</select>

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

Loading…
Cancel
Save