no message

main
이범준 1 year ago
parent f210bfe15c
commit c3be55a428

@ -1,246 +0,0 @@
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="ko">
<head>
<meta http-equiv="Content-Language" content="ko" >
<title>로그인</title>
<link href="<c:url value='/'/>resources/css/fims/framework/oldcommon.css" rel="stylesheet" type="text/css" >
<link href="<c:url value='/'/>resources/css/fims/framework/login.css" rel="stylesheet" type="text/css" >
<style>
.captcha_wrap {
margin-top: 10px;
text-align: right;
}
.captcha_wrap button {
padding: 5px;
font-weight: bold;
margin-left: -70px;
cursor: pointer;
}
.captcha_wrap input[type="text"] {
margin-left: 10px;
height: 45px;
width: 280px;
border: 2px solid #828282;
font-size: 17px;
font-family: Nanumsquare_B;
padding: 0 0 0 10px;
}
</style>
</head>
<body onload="fnInit();">
<div class="login_bg">
<div class="header_wrap">
<h1 class="logo"><img src="<c:url value='/'/>resources/image/fims/framework/login/mainLogo_02.png" alt="Logo Image"></img></h1>
</div>
<div class="login_text">
<p class="main_img"><img src="<c:url value='/'/>resources/image/fims/framework/login/loginDeco_02.png" alt=""></img></p>
<form:form id="loginForm" name="loginForm" method="post">
<div class="input_wrap">
<div class="input-group">
<input type="text" name="id" id="id" title="아이디 입력" class="typeText required form-control inp-long" placeholder="아이디" />
</div>
<div class="input-group input-group-merge mt-2">
<input type="password" name="passwd" id="passwd" title="비밀번호 입력" class="typePassword required form-control inp-long" placeholder="비밀번호"
onkeydown="javascript:if (event.keyCode == 13) { actionLogin(); }"/>
<span class="input-group-text cursor-pointer"><i class="bx bxs-lock"></i></span>
</div>
<div class="input_wrap2">
<!-- <label for="idSave"><input type="checkbox" id="idSave" name="idSave"/> ID저장</label> -->
<a href="#" onclick="javascript:fn_FindId(); return false;">아이디 찾기</a>
<a href="#" onclick="javascript:fn_FindPw(); return false;" class="line">비밀번호 찾기</a>
<a href="#" onclick="javascript:fnReg(); return false;" class="line">회원가입</a>
</div>
</div>
<input type="hidden" name="message" value="${message}" />
<input type="hidden" name="userSe" value="USR"/>
<input name="j_username" type="hidden"/>
</form:form>
<div class="btn_wrap">
<!-- <a href="#" onclick="javascript:fn_MngrInput(); return false;" class="line">회원가입</a> -->
<input type="submit" onclick="javascript:actionLogin()" class="typeButton" title="로그인" value="로그인" />
</div>
</div>
</div>
<script type="text/javascript">
/**
* 로그인
*/
function actionLogin() {
if (document.loginForm.id.value =="") {
alert("아이디를 입력하세요");
return false;
} else if (document.loginForm.passwd.value =="") {
alert("비밀번호를 입력하세요");
return false;
} else {
document.loginForm.action="<c:url value='/login/actionSecurityLogin.do'/>";
//document.loginForm.j_username.value = document.loginForm.userSe.value + document.loginForm.username.value;
//document.loginForm.action="<c:url value='/j_spring_security_check'/>";
document.loginForm.submit();
}
}
/**
* 쿠키 설정
*/
function setCookie (name, value, expires) {
document.cookie = name + "=" + escape (value) + "; path=/; expires=" + expires.toGMTString();
}
/**
* 쿠키 조회
* -쿠키에 저장된 목록을 조회 한다.
*/
function getCookie(Name) {
var search = Name + "="
if (document.cookie.length > 0) { // 쿠키가 설정되어 있다면
offset = document.cookie.indexOf(search)
if (offset != -1) { // 쿠키가 존재하면
offset += search.length
// set index of beginning of value
end = document.cookie.indexOf(";", offset)
// 쿠키 값의 마지막 위치 인덱스 번호 설정
if (end == -1)
end = document.cookie.length
return unescape(document.cookie.substring(offset, end))
}
}
return "";
}
/**
* 쿠키에 ID 저장or제거
* -"로그인ID 저장여부"를 check 시 일정기간동안 쿠키에 ID를 저장 한다.
* -"로그인ID 저장여부"를 uncheck 시 쿠키에 저장된 ID를 삭제 한다.
*/
function saveid(form) {
var expdate = new Date();
// 기본적으로 30일동안 기억하게 함. 일수를 조절하려면 * 30에서 숫자를 조절하면 됨
if (form.checkId.checked)
expdate.setTime(expdate.getTime() + 1000 * 3600 * 24 * 30); // 30일
else
expdate.setTime(expdate.getTime() - 1); // 쿠키 삭제조건
setCookie("saveid", form.id.value, expdate);
}
/**
* 쿠키에 저장된 ID 취득
* -저장된 ID가 존재할 경우 "로그인ID 저장여부"항목을 check 설정 한다.
*/
function getid(form) {
form.checkId.checked = ((form.id.value = getCookie("saveid")) != "");
}
function fnInit() {
var message = document.loginForm.message.value;
if (message != "") {
alert(message);
}
// getid(document.loginForm);
$('#id').focus();
//CaptchaUtil.init();
}
/**
* 회원가입 팝업
*/
function fnReg(){
CmmPopup.open("<c:url value='/framework/biz/mng/usr/addUserPopup.do'/>", {}, {width: 1100, height:570}, '사용자 등록');
}
/**
* 아이디 찾기 팝업
*/
function fn_FindId(){
CmmPopup.open("<c:url value='/login/findIdPopup/input.do'/>", {}, {width: 500, height:300}, '아이디 찾기');
}
/**
* 비밀번호 찾기 팝업
*/
function fn_FindPw(){
CmmPopup.open("<c:url value='/login/findPwdPopup/input.do'/>", {}, {width: 500, height:330}, '비밀번호 찾기');
}
/**
* 캡차 인증 도구
* @date 2020.09.22.
* @author 박민규
*/
var CaptchaUtil = {
init: function(){
//캡차인증 이미지 출력
//CaptchaUtil.refresh();
//새로고침 버튼 EventListener 설정
$('#btn_captchaRefresh').on({
click: function(){
//CaptchaUtil.refresh();
return false;
}
});
//자동로그인방지문자 입력란 EventListener 설정
$('#captcha').on({
keypress: function(){
if(event.keyCode==13){
actionLogin();
return false;
}
},
keyup: function(){
this.value = this.value.toLowerCase();
}
});
},
refresh: function(){
/* ==============================
* 2020.09.22 박민규
* IE 동작이슈 처리
* -사유: 크롬에서 정상동작 하나 IE에서 img 태그에 이미지가 출력된 상태에서
* document.querySelector('#captchaImg').setAttribute('src', url)를 호출해도 이벤트가 발생하지 않음.
* -해결: 이미지 태그의 src(이미지 경로)를 제거 후 timeout을 이용하여 일정시간 후 document.querySelector('#captchaImg').setAttribute('src', url) 호출
============================== */
//2020.09.22 주석처리
// var url = '<c:url value="/_anonymous_/captcha.do"/>';
// document.querySelector('#captchaImg').setAttribute('src', url);
var url = '<c:url value="/_anonymous_/captcha.do"/>';
// IE old version ( IE 10 or Lower )
if ( navigator.appName == "Microsoft Internet Explorer" ){
document.querySelector('#captchaImg').removeAttribute('src');
setTimeout(function(){
document.querySelector('#captchaImg').setAttribute('src', url);
}, 20);
}
// 그 외 브라우저
else{
document.querySelector('#captchaImg').setAttribute('src', url);
}
}
}
</script>
</body>
</html>

@ -0,0 +1,158 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<jsp:include page="/WEB-INF/jsp/include/head.jsp" />
<body>
<!-- Content -->
<div class="authentication-wrapper authentication-cover">
<div class="authentication-inner row m-0">
<!-- /Left Text -->
<div class="d-none d-lg-flex col-lg-7 col-xl-8 align-items-center p-5">
<div class="w-100 d-flex justify-content-center">
<img
src="<c:url value="/resources/img/illustrations/boy-with-rocket-light.png"/>"
class="img-fluid"
alt="Login image"
width="700"
data-app-dark-img="illustrations/boy-with-rocket-dark.png"
data-app-light-img="illustrations/boy-with-rocket-light.png"
/>
</div>
</div>
<!-- /Left Text -->
<!-- Login -->
<div class="d-flex col-12 col-lg-5 col-xl-4 align-items-center authentication-bg p-sm-5 p-4" style="background-color:white;">
<div class="w-px-400 mx-auto">
<!-- Logo -->
<div class="app-brand mb-5">
<a href="index.html" class="app-brand-link gap-2">
<span class="app-brand-logo demo">
<svg
width="25"
viewBox="0 0 25 42"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.7918663,0.358365126 L3.39788168,7.44174259 C0.566865006,9.69408886 -0.379795268,12.4788597 0.557900856,15.7960551 C0.68998853,16.2305145 1.09562888,17.7872135 3.12357076,19.2293357 C3.8146334,19.7207684 5.32369333,20.3834223 7.65075054,21.2172976 L7.59773219,21.2525164 L2.63468769,24.5493413 C0.445452254,26.3002124 0.0884951797,28.5083815 1.56381646,31.1738486 C2.83770406,32.8170431 5.20850219,33.2640127 7.09180128,32.5391577 C8.347334,32.0559211 11.4559176,30.0011079 16.4175519,26.3747182 C18.0338572,24.4997857 18.6973423,22.4544883 18.4080071,20.2388261 C17.963753,17.5346866 16.1776345,15.5799961 13.0496516,14.3747546 L10.9194936,13.4715819 L18.6192054,7.984237 L13.7918663,0.358365126 Z"
id="path-1"
></path>
<path
d="M5.47320593,6.00457225 C4.05321814,8.216144 4.36334763,10.0722806 6.40359441,11.5729822 C8.61520715,12.571656 10.0999176,13.2171421 10.8577257,13.5094407 L15.5088241,14.433041 L18.6192054,7.984237 C15.5364148,3.11535317 13.9273018,0.573395879 13.7918663,0.358365126 C13.5790555,0.511491653 10.8061687,2.3935607 5.47320593,6.00457225 Z"
id="path-3"
></path>
<path
d="M7.50063644,21.2294429 L12.3234468,23.3159332 C14.1688022,24.7579751 14.397098,26.4880487 13.008334,28.506154 C11.6195701,30.5242593 10.3099883,31.790241 9.07958868,32.3040991 C5.78142938,33.4346997 4.13234973,34 4.13234973,34 C4.13234973,34 2.75489982,33.0538207 2.37032616e-14,31.1614621 C-0.55822714,27.8186216 -0.55822714,26.0572515 -4.05231404e-15,25.8773518 C0.83734071,25.6075023 2.77988457,22.8248993 3.3049379,22.52991 C3.65497346,22.3332504 5.05353963,21.8997614 7.50063644,21.2294429 Z"
id="path-4"
></path>
<path
d="M20.6,7.13333333 L25.6,13.8 C26.2627417,14.6836556 26.0836556,15.9372583 25.2,16.6 C24.8538077,16.8596443 24.4327404,17 24,17 L14,17 C12.8954305,17 12,16.1045695 12,15 C12,14.5672596 12.1403557,14.1461923 12.4,13.8 L17.4,7.13333333 C18.0627417,6.24967773 19.3163444,6.07059163 20.2,6.73333333 C20.3516113,6.84704183 20.4862915,6.981722 20.6,7.13333333 Z"
id="path-5"
></path>
</defs>
<g id="g-app-brand" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Brand-Logo" transform="translate(-27.000000, -15.000000)">
<g id="Icon" transform="translate(27.000000, 15.000000)">
<g id="Mask" transform="translate(0.000000, 8.000000)">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<use fill="#696cff" xlink:href="#path-1"></use>
<g id="Path-3" mask="url(#mask-2)">
<use fill="#696cff" xlink:href="#path-3"></use>
<use fill-opacity="0.2" fill="#FFFFFF" xlink:href="#path-3"></use>
</g>
<g id="Path-4" mask="url(#mask-2)">
<use fill="#696cff" xlink:href="#path-4"></use>
<use fill-opacity="0.2" fill="#FFFFFF" xlink:href="#path-4"></use>
</g>
</g>
<g
id="Triangle"
transform="translate(19.000000, 11.000000) rotate(-300.000000) translate(-19.000000, -11.000000) "
>
<use fill="#696cff" xlink:href="#path-5"></use>
<use fill-opacity="0.2" fill="#FFFFFF" xlink:href="#path-5"></use>
</g>
</g>
</g>
</g>
</svg>
</span>
<span class="app-brand-text demo text-body fw-bolder">XIT Base Example</span>
</a>
</div>
<!-- /Logo -->
<h4 class="mb-2">반갑습니다, XIT Base입니다. 👋</h4>
<p class="mb-4">이 사이트는 XIT Base로 만든 예제 사이트 입니다.</p>
<div id="formAuthentication" class="mb-3">
<div class="mb-3">
<label for="userId" class="form-label">아이디</label>
<input id="userId" type="text" required class="form-control" placeholder="아이디를 입력하십시오." autofocus />
</div>
<div class="mb-3 form-password-toggle">
<div class="d-flex justify-content-between">
<label class="form-label" for="password">비밀번호</label>
<a href="auth-forgot-password-cover.html">
<small>비밀번호 찾기</small>
</a>
</div>
<div class="input-group input-group-merge">
<input id="password" type="password" required class="form-control" placeholder="비밀번호를 입력하십시오." aria-describedby="password" />
<span class="input-group-text cursor-pointer"><i class="bx bx-hide"></i></span>
</div>
</div>
<button class="btn btn-primary d-grid w-100" onclick="login();">로그인</button>
</div>
</div>
</div>
<!-- /Login -->
</div>
</div>
<!-- / Content -->
<jsp:include page="/WEB-INF/jsp/include/tail.jsp" />
<!-- Main JS -->
<script>
${functions}
function login() {
if (!$("#formAuthentication input").validInputs()) return;
var params = {
account:$("#userId").val(),
password:$("#password").val(),
institute:"default"
};
json.post({
url:wctx.url("/login.do"),
data:params,
success:function(resp) {
if (resp.authenticated) {
if (resp.message)
dialog.alert(resp.message);
wctx.home();
} else {
dialog.alert({
content:resp.reason,
onClose:() => $("#userId").focus()
});
}
}
});
}
$(function(){
$("#formAuthentication input").onEnterPress(login);
});
</script>
</body>
</html>

@ -1,158 +1,246 @@
<%@ 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"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:include page="/WEB-INF/jsp/include/head.jsp" /> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<body>
<!-- Content --> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<div class="authentication-wrapper authentication-cover"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<div class="authentication-inner row m-0"> <html lang="ko">
<!-- /Left Text --> <head>
<div class="d-none d-lg-flex col-lg-7 col-xl-8 align-items-center p-5"> <meta http-equiv="Content-Language" content="ko" >
<div class="w-100 d-flex justify-content-center"> <title>로그인</title>
<img
src="<c:url value="/resources/img/illustrations/boy-with-rocket-light.png"/>" <link href="<c:url value='/'/>resources/css/fims/framework/oldcommon.css" rel="stylesheet" type="text/css" >
class="img-fluid" <link href="<c:url value='/'/>resources/css/fims/framework/login.css" rel="stylesheet" type="text/css" >
alt="Login image"
width="700"
data-app-dark-img="illustrations/boy-with-rocket-dark.png" <style>
data-app-light-img="illustrations/boy-with-rocket-light.png" .captcha_wrap {
/> margin-top: 10px;
</div> text-align: right;
</div> }
<!-- /Left Text --> .captcha_wrap button {
padding: 5px;
<!-- Login --> font-weight: bold;
<div class="d-flex col-12 col-lg-5 col-xl-4 align-items-center authentication-bg p-sm-5 p-4" style="background-color:white;"> margin-left: -70px;
<div class="w-px-400 mx-auto"> cursor: pointer;
<!-- Logo --> }
<div class="app-brand mb-5"> .captcha_wrap input[type="text"] {
<a href="index.html" class="app-brand-link gap-2"> margin-left: 10px;
<span class="app-brand-logo demo"> height: 45px;
<svg width: 280px;
width="25" border: 2px solid #828282;
viewBox="0 0 25 42" font-size: 17px;
version="1.1" font-family: Nanumsquare_B;
xmlns="http://www.w3.org/2000/svg" padding: 0 0 0 10px;
xmlns:xlink="http://www.w3.org/1999/xlink" }
> </style>
<defs>
<path </head>
d="M13.7918663,0.358365126 L3.39788168,7.44174259 C0.566865006,9.69408886 -0.379795268,12.4788597 0.557900856,15.7960551 C0.68998853,16.2305145 1.09562888,17.7872135 3.12357076,19.2293357 C3.8146334,19.7207684 5.32369333,20.3834223 7.65075054,21.2172976 L7.59773219,21.2525164 L2.63468769,24.5493413 C0.445452254,26.3002124 0.0884951797,28.5083815 1.56381646,31.1738486 C2.83770406,32.8170431 5.20850219,33.2640127 7.09180128,32.5391577 C8.347334,32.0559211 11.4559176,30.0011079 16.4175519,26.3747182 C18.0338572,24.4997857 18.6973423,22.4544883 18.4080071,20.2388261 C17.963753,17.5346866 16.1776345,15.5799961 13.0496516,14.3747546 L10.9194936,13.4715819 L18.6192054,7.984237 L13.7918663,0.358365126 Z" <body onload="fnInit();">
id="path-1" <div class="login_bg">
></path> <div class="header_wrap">
<path <h1 class="logo"><img src="<c:url value='/'/>resources/image/fims/framework/login/mainLogo_02.png" alt="Logo Image"></img></h1>
d="M5.47320593,6.00457225 C4.05321814,8.216144 4.36334763,10.0722806 6.40359441,11.5729822 C8.61520715,12.571656 10.0999176,13.2171421 10.8577257,13.5094407 L15.5088241,14.433041 L18.6192054,7.984237 C15.5364148,3.11535317 13.9273018,0.573395879 13.7918663,0.358365126 C13.5790555,0.511491653 10.8061687,2.3935607 5.47320593,6.00457225 Z" </div>
id="path-3" <div class="login_text">
></path> <p class="main_img"><img src="<c:url value='/'/>resources/image/fims/framework/login/loginDeco_02.png" alt=""></img></p>
<path <form:form id="loginForm" name="loginForm" method="post">
d="M7.50063644,21.2294429 L12.3234468,23.3159332 C14.1688022,24.7579751 14.397098,26.4880487 13.008334,28.506154 C11.6195701,30.5242593 10.3099883,31.790241 9.07958868,32.3040991 C5.78142938,33.4346997 4.13234973,34 4.13234973,34 C4.13234973,34 2.75489982,33.0538207 2.37032616e-14,31.1614621 C-0.55822714,27.8186216 -0.55822714,26.0572515 -4.05231404e-15,25.8773518 C0.83734071,25.6075023 2.77988457,22.8248993 3.3049379,22.52991 C3.65497346,22.3332504 5.05353963,21.8997614 7.50063644,21.2294429 Z" <div class="input_wrap">
id="path-4" <div class="input-group">
></path> <input type="text" name="id" id="id" title="아이디 입력" class="typeText required form-control inp-long" placeholder="아이디" />
<path </div>
d="M20.6,7.13333333 L25.6,13.8 C26.2627417,14.6836556 26.0836556,15.9372583 25.2,16.6 C24.8538077,16.8596443 24.4327404,17 24,17 L14,17 C12.8954305,17 12,16.1045695 12,15 C12,14.5672596 12.1403557,14.1461923 12.4,13.8 L17.4,7.13333333 C18.0627417,6.24967773 19.3163444,6.07059163 20.2,6.73333333 C20.3516113,6.84704183 20.4862915,6.981722 20.6,7.13333333 Z" <div class="input-group input-group-merge mt-2">
id="path-5" <input type="password" name="passwd" id="passwd" title="비밀번호 입력" class="typePassword required form-control inp-long" placeholder="비밀번호"
></path> onkeydown="javascript:if (event.keyCode == 13) { actionLogin(); }"/>
</defs> <span class="input-group-text cursor-pointer"><i class="bx bxs-lock"></i></span>
<g id="g-app-brand" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> </div>
<g id="Brand-Logo" transform="translate(-27.000000, -15.000000)">
<g id="Icon" transform="translate(27.000000, 15.000000)"> <div class="input_wrap2">
<g id="Mask" transform="translate(0.000000, 8.000000)"> <!-- <label for="idSave"><input type="checkbox" id="idSave" name="idSave"/> ID저장</label> -->
<mask id="mask-2" fill="white"> <a href="#" onclick="javascript:fn_FindId(); return false;">아이디 찾기</a>
<use xlink:href="#path-1"></use> <a href="#" onclick="javascript:fn_FindPw(); return false;" class="line">비밀번호 찾기</a>
</mask> <a href="#" onclick="javascript:fnReg(); return false;" class="line">회원가입</a>
<use fill="#696cff" xlink:href="#path-1"></use> </div>
<g id="Path-3" mask="url(#mask-2)"> </div>
<use fill="#696cff" xlink:href="#path-3"></use> <input type="hidden" name="message" value="${message}" />
<use fill-opacity="0.2" fill="#FFFFFF" xlink:href="#path-3"></use> <input type="hidden" name="userSe" value="USR"/>
</g> <input name="j_username" type="hidden"/>
<g id="Path-4" mask="url(#mask-2)"> </form:form>
<use fill="#696cff" xlink:href="#path-4"></use> <div class="btn_wrap">
<use fill-opacity="0.2" fill="#FFFFFF" xlink:href="#path-4"></use> <!-- <a href="#" onclick="javascript:fn_MngrInput(); return false;" class="line">회원가입</a> -->
</g> <input type="submit" onclick="javascript:actionLogin()" class="typeButton" title="로그인" value="로그인" />
</g> </div>
<g </div>
id="Triangle" </div>
transform="translate(19.000000, 11.000000) rotate(-300.000000) translate(-19.000000, -11.000000) "
>
<use fill="#696cff" xlink:href="#path-5"></use> <script type="text/javascript">
<use fill-opacity="0.2" fill="#FFFFFF" xlink:href="#path-5"></use>
</g>
</g> /**
</g> * 로그인
</g> */
</svg> function actionLogin() {
</span>
<span class="app-brand-text demo text-body fw-bolder">XIT Base Example</span> if (document.loginForm.id.value =="") {
</a> alert("아이디를 입력하세요");
</div> return false;
<!-- /Logo --> } else if (document.loginForm.passwd.value =="") {
<h4 class="mb-2">반갑습니다, XIT Base입니다. 👋</h4> alert("비밀번호를 입력하세요");
<p class="mb-4">이 사이트는 XIT Base로 만든 예제 사이트 입니다.</p> return false;
} else {
<div id="formAuthentication" class="mb-3"> document.loginForm.action="<c:url value='/login/.do'/>";
<div class="mb-3"> //document.loginForm.j_username.value = document.loginForm.userSe.value + document.loginForm.username.value;
<label for="userId" class="form-label">아이디</label> //document.loginForm.action="<c:url value='/j_spring_security_check'/>";
<input id="userId" type="text" required class="form-control" placeholder="아이디를 입력하십시오." autofocus /> document.loginForm.submit();
</div> }
<div class="mb-3 form-password-toggle"> }
<div class="d-flex justify-content-between">
<label class="form-label" for="password">비밀번호</label> /**
<a href="auth-forgot-password-cover.html"> * 쿠키 설정
<small>비밀번호 찾기</small> */
</a> function setCookie (name, value, expires) {
</div> document.cookie = name + "=" + escape (value) + "; path=/; expires=" + expires.toGMTString();
<div class="input-group input-group-merge"> }
<input id="password" type="password" required class="form-control" placeholder="비밀번호를 입력하십시오." aria-describedby="password" />
<span class="input-group-text cursor-pointer"><i class="bx bx-hide"></i></span> /**
</div> * 쿠키 조회
</div> * -쿠키에 저장된 목록을 조회 한다.
*/
<button class="btn btn-primary d-grid w-100" onclick="login();">로그인</button> function getCookie(Name) {
</div> var search = Name + "="
if (document.cookie.length > 0) { // 쿠키가 설정되어 있다면
</div> offset = document.cookie.indexOf(search)
</div> if (offset != -1) { // 쿠키가 존재하면
<!-- /Login --> offset += search.length
</div> // set index of beginning of value
</div> end = document.cookie.indexOf(";", offset)
// 쿠키 값의 마지막 위치 인덱스 번호 설정
<!-- / Content --> if (end == -1)
<jsp:include page="/WEB-INF/jsp/include/tail.jsp" /> end = document.cookie.length
<!-- Main JS --> return unescape(document.cookie.substring(offset, end))
<script>
${functions}
function login() {
if (!$("#formAuthentication input").validInputs()) return;
var params = {
account:$("#userId").val(),
password:$("#password").val(),
institute:"default"
};
json.post({
url:wctx.url("/login.do"),
data:params,
success:function(resp) {
if (resp.authenticated) {
if (resp.message)
dialog.alert(resp.message);
wctx.home();
} else {
dialog.alert({
content:resp.reason,
onClose:() => $("#userId").focus()
});
} }
} }
}); return "";
} }
/**
* 쿠키에 ID 저장or제거
* -"로그인ID 저장여부"를 check 시 일정기간동안 쿠키에 ID를 저장 한다.
* -"로그인ID 저장여부"를 uncheck 시 쿠키에 저장된 ID를 삭제 한다.
*/
function saveid(form) {
var expdate = new Date();
// 기본적으로 30일동안 기억하게 함. 일수를 조절하려면 * 30에서 숫자를 조절하면 됨
if (form.checkId.checked)
expdate.setTime(expdate.getTime() + 1000 * 3600 * 24 * 30); // 30일
else
expdate.setTime(expdate.getTime() - 1); // 쿠키 삭제조건
setCookie("saveid", form.id.value, expdate);
}
$(function(){ /**
* 쿠키에 저장된 ID 취득
* -저장된 ID가 존재할 경우 "로그인ID 저장여부"항목을 check 설정 한다.
*/
function getid(form) {
form.checkId.checked = ((form.id.value = getCookie("saveid")) != "");
}
function fnInit() {
var message = document.loginForm.message.value;
if (message != "") {
alert(message);
}
// getid(document.loginForm);
$('#id').focus();
//CaptchaUtil.init();
}
/**
* 회원가입 팝업
*/
function fnReg(){
CmmPopup.open("<c:url value='/framework/biz/mng/usr/addUserPopup.do'/>", {}, {width: 1100, height:570}, '사용자 등록');
}
/**
* 아이디 찾기 팝업
*/
function fn_FindId(){
CmmPopup.open("<c:url value='/login/findIdPopup/input.do'/>", {}, {width: 500, height:300}, '아이디 찾기');
}
/**
* 비밀번호 찾기 팝업
*/
function fn_FindPw(){
CmmPopup.open("<c:url value='/login/findPwdPopup/input.do'/>", {}, {width: 500, height:330}, '비밀번호 찾기');
}
/**
* 캡차 인증 도구
* @date 2020.09.22.
* @author 박민규
*/
var CaptchaUtil = {
init: function(){
//캡차인증 이미지 출력
//CaptchaUtil.refresh();
//새로고침 버튼 EventListener 설정
$('#btn_captchaRefresh').on({
click: function(){
//CaptchaUtil.refresh();
return false;
}
});
//자동로그인방지문자 입력란 EventListener 설정
$('#captcha').on({
keypress: function(){
if(event.keyCode==13){
actionLogin();
return false;
}
},
keyup: function(){
this.value = this.value.toLowerCase();
}
});
},
refresh: function(){
/* ==============================
* 2020.09.22 박민규
* IE 동작이슈 처리
* -사유: 크롬에서 정상동작 하나 IE에서 img 태그에 이미지가 출력된 상태에서
* document.querySelector('#captchaImg').setAttribute('src', url)를 호출해도 이벤트가 발생하지 않음.
* -해결: 이미지 태그의 src(이미지 경로)를 제거 후 timeout을 이용하여 일정시간 후 document.querySelector('#captchaImg').setAttribute('src', url) 호출
============================== */
//2020.09.22 주석처리
// var url = '<c:url value="/_anonymous_/captcha.do"/>';
// document.querySelector('#captchaImg').setAttribute('src', url);
var url = '<c:url value="/_anonymous_/captcha.do"/>';
// IE old version ( IE 10 or Lower )
if ( navigator.appName == "Microsoft Internet Explorer" ){
document.querySelector('#captchaImg').removeAttribute('src');
setTimeout(function(){
document.querySelector('#captchaImg').setAttribute('src', url);
}, 20);
}
// 그 외 브라우저
else{
document.querySelector('#captchaImg').setAttribute('src', url);
}
}
}
$("#formAuthentication input").onEnterPress(login);
});
</script> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save