-
Notifications
You must be signed in to change notification settings - Fork 2
/
customLogin.jsp
119 lines (106 loc) · 3.07 KB
/
customLogin.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="<%=request.getContextPath() %>/resources/css/customLogin.css" rel="stylesheet" type="text/css">
</head>
<body>
<div class='login'>
<div class="customLogin">
<div class="customLogin-header"></div>
<div class="customLogin-body">
<h1 style="font-family:Open Sans; color:rgb(75,75,75)">Sign In</h1>
<h2>
<c:out value="${msg}" />
${msg}
</h2>
<h2>
<c:out value="${logout}" />
</h2>
<h3>
<c:out value="${loginFailMsg}" />
</h3>
<form method="post" action="/login" id="loginForm">
<div class="loginBoxWrapper">
<div class="loginBox">
<label class="loginLabels">Email</label> <input
class="loginInputs" type="email" name="userEmail" id="userEmail"
placeholder="이메일을 입력해주세요." autofocus>
</div>
<div class="loginBox">
<label class="loginLabels">Password</label> <input
class="loginInputs" type="password" name="userPW" id="userPW"
placeholder="비밀번호를 입력해주세요.">
<div>
<input type="checkbox" name="remember-me">Remember Me
</div>
<div class="findBox">
<input type="button" class="findIDPW" id="findPasswordBtn" value="비밀번호 찾기"/>
<input type="button" class="findIDPW" id="findPassIdBtn" value="아이디 찾기"/>
</div>
</div>
<div class="loginBox">
<button class="loginsubmit">확 인</button>
</div>
</div>
<input type="hidden" name="${_csrf.parameterName }"
value="${_csrf.token }" />
</form>
</div>
</div>
</div>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script>
let userEmail = document.getElementById('userEmail');
let userPW = document.getElementById('userPW');
$(".loginsubmit").on("click", function(e) {
e.preventDefault();
if(checkForm()) $("#loginForm").submit();
});
function checkForm() {
var regexEmail = /^[-A-Za-z0-9_]+[-A-Za-z0-9_.]*[@]{1}[-A-Za-z0-9_]+[-A-Za-z0-9_.]*[.]{1}[A-Za-z]{1,5}$/;
if (userEmail.value == ''|| !(regexEmail.test(userEmail.value))) {
alert("이메일을 입력해주세요.");
userEmail.focus();
return false;
}
if (userPW.value == '') {
alert("비밀번호를 입력해주세요.");
userPW.focus();
return false;
}
else return true;
}
$("#findPasswordBtn").on("click",function(e){
$.ajax({
url:'/member/findPw',
type:'GET',
success : function(result) {
$('#include').html(result);
}
});
});
$("#findPasswordBtn").on("click",function(e){
$.ajax({
url:'/member/findPw',
type:'GET',
success : function(result) {
$('#include').html(result);
}
});
});
$("#findPassIdBtn").on("click",function(e){
$.ajax({
url:'/member/findEmail',
type:'GET',
success : function(result) {
$('#include').html(result);
}
});
});
</script>
</body>
</html>