-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
40 lines (38 loc) · 1.07 KB
/
index.html
File metadata and controls
40 lines (38 loc) · 1.07 KB
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
<!DOCTYPE html>
<html lang="zh">
<head>
<link rel="stylesheet" type="text/css" href="css/index.css">
<script src="Bmob-2.4.0.min.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script>Bmob.initialize("c9030a2692be64b0", "521979");
Bmob.debug(true);
function register(){
let params = {
username: document.getElementById("username").value,
password: document.getElementById("pwd").value
}
Bmob.User.register(params).then(res => {
location.href="login.html";
}).catch(err => {
alert(err.error);
});
}
</script>
<title>先注册账号哦!</title>
</head>
<body>
<div id="login_box">
<h2>注册</h2>
<div id="input_box">
<input type="text" placeholder="请输入用户名" id="username">
</div>
<div class="input_box">
<input type="password" placeholder="请输入密码" id="pwd">
</div>
<button onclick="register()">注 册</button>
<button onclick="window.location.href='login.html'">已有账号点这里</p>
<br>
</div>
</body>
</html>