-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
68 lines (65 loc) · 1.72 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>登录页面</title>
<link rel="stylesheet" type="text/css" href="css/index.css" />
<link href="https://fonts.font.im/css?family=Hanalei+Fill" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.0.0.min.js"></script>
<script type="text/javascript" src="js/index.js"></script>
</head>
<body>
<div class="bigbox">
<div class="begin">
<div class="word1">餐厅后台管理系统</div>
<div class="secret">
<h1>密码登录</h1>
<input type="text" id="us" placeholder="输入账号..." oncontextmenu="return false">
<input type="text" id="ps" placeholder="输入密码..." oncontextmenu="return false">
<button type="button" id="login">
登录
</button>
<button type="button">
注册
</button>
<h5>忘记密码</h5>
<div class="word2">第三方登录</div>
<center>
<img src="./img/1.png">
<img src="./img/2.png">
<img src="./img/3.png">
</center>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$("#login").click(function() {
$.ajax({
type:"post",
url: "http://39.105.232.109:3000/user/login",
async:true,
dataType: "json",
data:{
us: $("#us").val(),
ps: $("#ps").val(),
},
success: function(data) {
console.log(data)
if (data.err == 0) {
window.location.href = "index1.html"
var login_id=data._id
localStorage.setItem("login_id",login_id)
console.log(data)
}
else{
alert("用户名或密码错误!")
}
}
})
})
});
</script>
</body>
</html>