login.html
4.61 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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>登录</title>
<meta name=”renderer” content=”webkit”>
<meta http-equiv=”X-UA-Compatible” content=”IE=Edge,chrome=1″>
<meta content="width=device-width, initial-scale=1" name="viewport" />
<meta content="" name="description" />
<meta content="" name="author" />
<!-- BEGIN GLOBAL MANDATORY STYLES -->
<link
href="metronic_v4.5.4/plugins/font-awesome/css/font-awesome.min.css"
rel="stylesheet" type="text/css" />
<link href="metronic_v4.5.4/plugins/bootstrap/css/bootstrap.min.css"
rel="stylesheet" type="text/css" />
<link href="metronic_v4.5.4/css/components.css" rel="stylesheet"
type="text/css" />
<link href="metronic_v4.5.4/css/plugins.css" rel="stylesheet"
type="text/css" />
<style type="text/css">
/* Cubic Bezier Transition */
/***
Login page
***/
/* bg color */
.login {
width: 100%;
height: 100%;
background-image: url(./assets/img/login_bgbg.png);
background-size: 100%
}
.loginCenter {
background-image: url(./assets/img/login_bgcenter.png);
background-repeat: no-repeat;
background-size: 100%;
width: 768px;
height: 283.2px;
margin: auto;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.loginInputDiv {
top: 48%;
/* width: 80%;
position: absolute;
vertical-align: middle;
text-align: center; */
}
/* .loginInput {
height: 35px;
padding: 6px 12px;
background-color: #fff;
border: 1px solid #c2cad8;
border-radius: 2px !important;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
-webkit-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
} */
.buttonLogin {
cursor: pointer;
}
.login-form{
position: relative;
width: 100%;
height: 100%;
text-align: center;
}
</style>
</head>
<body class="login">
<div class="loginCenter">
<form class="login-form" action="/login" method="post">
<div class="col-md-12 loginInputDiv">
<div class="input-icon right" style="display: inline-block;">
<i class="fa fa-user"></i>
<input type="text" class="form-control " placeholder="用户名" name="username" value="admin"> </div>
<div class="input-icon right" style="display: inline-block;">
<i class="fa fa-key"></i>
<input type="password" class="form-control " placeholder="密码" name="password" value="" > </div>
<button type="submit" class="btn blue buttonLogin" style="border-radius: 5px !important;
font-family: 微软雅黑;">登 录</button>
</div>
</form>
</div>
<script src="metronic_v4.5.4/plugins/jquery.min.js"
type="text/javascript"></script>
<script src="metronic_v4.5.4/plugins/bootstrap/js/bootstrap.min.js"
type="text/javascript"></script>
<script src="metronic_v4.5.4/scripts/app.min.js" type="text/javascript"></script>
<script src="assets/plugins/purl.js"></script>
<script type="text/javascript">
$(function() {
$('input[name=password]').focus();
/* setCenterCss(); */
if ($.url().param('error')) {
//去session里查一下失败信息
$.get('/user/loginFailure', function(msg) {
if (msg && msg != '')
alert(msg);
location.href = '/login.html';
});
}
/* $(window).resize(setCenterCss); */
// 设置登录界面样式,让登陆框始终居中
/* function setCenterCss() {
$(".loginCenter").css({
width : $(window).width() * 0.4,
height : $(window).height() * 0.2,
});
$(".loginCenter").css({
left : ($(window).width() - $(".loginCenter") .outerWidth()) / 2,
top : ($(window).height() - $(".loginCenter") .outerHeight()) / 2
});
} */
// 设置两个输入框的高度和左边图片高度一致,宽度为父DIV loginInputDiv减 去三个按钮的宽带度/2*0。8
/* $(".loginInput").css({
height : $("#img_user").height(),
width : ($(".loginInputDiv").width()- $("#img_user").width() * 2 -
$(".buttonLogin").width()) / 2 * 0.8
}); */
// 设置中间登陆框DIV左右居中
/* $(".loginInputDiv").css({
left : ($(".loginCenter").outerWidth() - $(".loginInputDiv").outerWidth()) / 2,
}); */
$(".buttonLogin").bind("click", function() {
$(".login-form").submit();
});
});
</script>
</body>
</html>