-
Notifications
You must be signed in to change notification settings - Fork 25
/
login.html
77 lines (73 loc) · 2.92 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
74
75
76
77
<html lang="ch">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta name="theme-color" content="#3F51B5" />
<title>登录 - SadFile</title>
<link rel="stylesheet" href="http://cdnjs.loli.net/ajax/libs/mdui/0.4.3/css/mdui.min.css">
<link href="https://cdn.bootcss.com/viewerjs/1.3.6/viewer.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/dplayer/1.25.0/DPlayer.min.css">
<link rel="stylesheet" type="text/css" href="static/css/prism.css">
<link rel="stylesheet" type="text/css" href="static/css/wx-audio.css">
<script type="text/javascript" src="http://at.alicdn.com/t/font_1334636_vc764p8yiqm.js"></script>
<style type="text/css">
@media screen and (max-width: 500px){
#main{
width: 90%!important;
}
h1 {
font-size: 36px!important;
}
}
</style>
</head>
<body>
<div class="mdui-appbar mdui-theme-primary-indigo mdui-shadow-0">
<div class="mdui-toolbar mdui-color-theme ">
<a href="javascript:;" class="mdui-btn mdui-btn-icon"><i class="mdui-icon material-icons">menu</i></a>
<a href="javascript:;" class="mdui-typo-headline">SadFile</a>
<a href="javascript:;" class="mdui-typo-title">登录</a>
</div>
</div>
<div>
<h1 align="center" style="margin-top: 80px;font-weight: 300;font-size: 42px;">SadFile Login</h1>
<div id="main" style="width: 400px;height: auto;margin: 0 auto">
<div class="mdui-textfield">
<i class="mdui-icon material-icons">account_circle</i>
<input class="mdui-textfield-input" id="username" type="text" placeholder="用户名"/>
</div>
<div class="mdui-textfield">
<i class="mdui-icon material-icons">lock</i>
<input class="mdui-textfield-input" id="password" type="password" placeholder="密码"/>
</div>
<button id="login" class="mdui-btn mdui-color-indigo mdui-ripple mdui-center" style="margin-top: 30px;">登录</button>
</div>
</div>
</body>
</html>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script type="text/javascript">
$("#login").click(function () {
var username = $("#username").val();
var password = $("#password").val();
$(this).text("登录中");
$.ajax({
url:"./function/api.php",
method:"post",
data:{"username":username,"password":password},
success:function(data){
var data = JSON.parse(data);
if (data['status']==200) {
window.location.href="/";
}else{
$("#login").text("登录");
$("#username").val("");
$("#password").val("");
}
}
})
})
</script>