forked from potato179/qspace
/
login.html
73 lines (70 loc) · 2.79 KB
/
login.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>로그인 - QSpace</title>
<link href="https://getbootstrap.com/docs/4.5/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<link rel="stylesheet" href="./public/border.css">
<link rel="stylesheet" href="./public/box.css">
<link rel="stylesheet" href="./public/button.css">
<link rel="stylesheet" href="./public/footer.css">
<link rel="stylesheet" href="./public/font.css">
<link rel="stylesheet" href="./public/outline.css">
<script src="https://kit.fontawesome.com/06fb83cb17.js" crossorigin="anonymous"></script>
<style>
body{
background: black;
}
</style>
</head>
<body class="text-center">
<form class="form-signin">
<br><br>
<i class = "white fas fa-sign-in-alt" style = "font-size: 400%;"></i>
<br><br>
<h1 class = "white h3 mb-3 superbig">로그인</h1>
<br><br>
<label for="inputEmail" class="sr-only">이메일</label>
<input type = "email" name = "email" id = "email" class = "form-control" placeholder = "이메일" required autofocus>
<label for="inputPassword" class="sr-only">비밀번호</label>
<input type="password" name = "pw" id="pw" class="form-control" placeholder="비밀번호" required>
<br><br><br>
<button class="btn btn-lg btn-primary btn-block" type="submit" onclick="signin();">로그인</button>
<p class="mt-5 mb-3 text-muted"><a href="./join.html">회원가입</a><br><br><a href="./index.html">홈으로 돌아가기</a></p>
</form>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script>
function signin() {
console.log(`signin`);
var email = $('#email').val();
var pw = $('#pw').val();
var sendData = {
email: email,
pw: pw
};
var ajaxData = {
type: "GET",
url : "login",
data: sendData,
dataType: "json",
success : onSuccess,
error: onError
};
$.ajax(ajaxData);
}
function onSuccess (data, status, xhr) {
console.log(data);
if(data.condition == "success"){
alert(data.message);
window.location.href = "index.html"
}
else if(data.condition == "fail"){
alert(data.message);
}
}
function onError (jqXHR, textStatus, errorThrown) {
console.log(jqXHR.responseText);
}
</script>
</body>
</html>