-
Notifications
You must be signed in to change notification settings - Fork 0
/
register.html
107 lines (99 loc) · 4.46 KB
/
register.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="author" content="Kodinger">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>注册</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" href="css/my-login.css">
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body class="my-login-page">
<section class="h-100">
<div class="container h-100">
<div class="row justify-content-md-center h-100">
<div class="card-wrapper">
<div class="brand">
<img src="img/logo.png" alt="bootstrap 4 login page">
</div>
<div class="card fat">
<div class="card-body">
<h4 class="card-title">注册</h4>
<div class="form-group">
<label for="name">用户名</label>
<input id="name" type="text" class="form-control" name="name" required autofocus>
<div class="invalid-feedback">
What's your name?
</div>
</div>
<div class="form-group">
<label for="email">邮箱</label>
<input id="email" type="email" class="form-control" name="email" required>
<div class="invalid-feedback">
Your email is invalid
</div>
</div>
<div class="form-group">
<label for="password">密码</label>
<input id="password" type="password" class="form-control" name="password" required data-eye>
<div class="invalid-feedback">
Password is required
</div>
</div>
<div class="form-group">
<div class="custom-checkbox custom-control">
<input type="checkbox" name="agree" id="agree" class="custom-control-input" required="">
<label for="agree" class="custom-control-label">I agree to the <a href="#">Terms and
Conditions</a></label>
<div class="invalid-feedback">
You must agree with our Terms and Conditions
</div>
</div>
</div>
<div class="form-group m-0">
<button onclick="sendUser()" class="btn btn-primary btn-block">
注册
</button>
</div>
<div class="mt-4 text-center">
已经有帐号? <a href="login.html">登录</a>
</div>
</div>
</div>
<div class="footer">
Copyright © 2022 — ppReader
</div>
</div>
</div>
</div>
</section>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
crossorigin="anonymous"></script>
<script src="js/my-login.js"></script>
</body>
<script>
function sendUser() {
alert("Send")
var name = $("#name").val();
var password = $("#password").val();
var email = $("#email").val();
//判断用户名是否为空
$.ajax({
type: "GET",
url: "https://ppreader.creativecc.cn/api/others/insertuser" + "?name=" + name + "&password=" + password + "&email=" + email,
data: "",
success: function (data) {
alert(data['id'])
console.log(data['id'])
window.location.href = 'login.html';
},
error: function (data) {
alert("error!")
}
});
}
</script>
</html>