로그인화면 수정

main
이범준 5 months ago
parent aac9188ebd
commit 17e0ea0eec

@ -9,7 +9,6 @@ import org.springframework.context.annotation.ImportResource;
import cokr.xit.base.ServletCustomizer; import cokr.xit.base.ServletCustomizer;
import cokr.xit.base.boot.XitBaseApplication; import cokr.xit.base.boot.XitBaseApplication;
import cokr.xit.fims.task.TaskMvcConfig; import cokr.xit.fims.task.TaskMvcConfig;
import cokr.xit.foundation.boot.Yml;
@ImportAutoConfiguration({ServletCustomizer.class, TaskMvcConfig.class}) @ImportAutoConfiguration({ServletCustomizer.class, TaskMvcConfig.class})
@ImportResource("classpath:spring/context-*.xml") @ImportResource("classpath:spring/context-*.xml")
@ -17,17 +16,6 @@ public class FimsApplication extends XitBaseApplication {
public static void main(String[] args) { public static void main(String[] args) {
try {
Yml yml = new Yml("application", "application.yml");
String serverSggCd = yml.getValue("server.sggCd");
String serverInstCd = yml.getValue("server.instCd");
System.setProperty("instCd", serverInstCd);
System.setProperty("sggCd", serverSggCd);
} catch (Exception e) {
throw new RuntimeException("서버정보 로드 오류");
}
final SpringApplicationBuilder applicationBuilder = new SpringApplicationBuilder(FimsApplication.class); final SpringApplicationBuilder applicationBuilder = new SpringApplicationBuilder(FimsApplication.class);
final SpringApplication application = applicationBuilder.build(); final SpringApplication application = applicationBuilder.build();
application.setBannerMode(Banner.Mode.OFF); application.setBannerMode(Banner.Mode.OFF);

@ -5,6 +5,7 @@ import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -20,6 +21,12 @@ import cokr.xit.foundation.web.RequestHandlerReader;
@Controller @Controller
public class MainController extends cokr.xit.base.web.MainController { public class MainController extends cokr.xit.base.web.MainController {
@Value("${server.sggCd}")
private String sggCd;
@Value("${server.instCd}")
private String instCd;
@Autowired @Autowired
private TaskRequestMappingHandlerMapping requestHandlers; private TaskRequestMappingHandlerMapping requestHandlers;
@ -31,9 +38,14 @@ 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> sggList = fimsOgdpBean.selectAllSggList(); List<DataObject> sggList = fimsOgdpBean.selectAllSggList();
mav.addObject("sggList", sggList); mav.addObject("sggList", sggList);
mav.addObject("sysInstCd", instCd);
mav.addObject("sysSggCd", sggCd);
return mav; return mav;
} }

@ -1,6 +1,5 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> <%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<% String systemInst = System.getProperty("instCd") != null ? System.getProperty("instCd") : ""; %>
<!DOCTYPE html> <!DOCTYPE html>
<html <html
lang="kr" lang="kr"
@ -213,15 +212,15 @@ function fn_FindPw(){
$(function(){ $(function(){
$("#formAuthentication input").onEnterPress(login); $("#formAuthentication input").onEnterPress(login);
let sysInst = "<%= systemInst %>"; let sysSgg = "${sysSggCd}";
let cookieOrg = "${cookie['userInstitute'].getValue()}"; let cookieOrg = "${cookie['userOrg'].getValue()}";
let cookieUserId = "${cookie['userAccount'].getValue()}"; let cookieUserId = "${cookie['userAccount'].getValue()}";
let hasCookie = (cookieInst != "" && cookieUserId != ""); let hasCookie = (cookieOrg != "" && cookieUserId != "");
let selectValue = ""; let selectValue = "";
let isSelectable = false; let isSelectable = false;
if(hasCookie){ if(hasCookie){
selectValue = cookieInst; selectValue = cookieOrg;
isSelectable = $("#orgID option[value='"+selectValue+"']").not("[disabled]").length; isSelectable = $("#orgID option[value='"+selectValue+"']").not("[disabled]").length;
if(isSelectable){ if(isSelectable){
$("#orgID").val(cookieOrg); $("#orgID").val(cookieOrg);
@ -232,7 +231,7 @@ $(function(){
} }
} }
selectValue = sysInst; selectValue = sysSgg;
isSelectable = $("#institute option[value='"+selectValue+"']").not("[disabled]").length; isSelectable = $("#institute option[value='"+selectValue+"']").not("[disabled]").length;
if(isSelectable){ if(isSelectable){
$("#orgID").val(selectValue); $("#orgID").val(selectValue);

Loading…
Cancel
Save