3371dbc6
孙向锦
0720 版本
|
1
2
3
4
5
6
7
8
9
10
11
|
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html>
|
a9f5da51
孙向锦
更换首页
|
12
|
<html lang="zh-CN">
|
eef2f078
孙向锦
修改域名问题
|
13
14
15
16
17
|
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>中天电子-教育管理系统</title>
|
ad5081d3
孙向锦
初始化项目
|
18
|
|
eef2f078
孙向锦
修改域名问题
|
19
20
21
22
23
24
25
26
27
28
29
|
<!-- Bootstrap -->
<link
href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
rel="stylesheet">
<link href="static/login/style_login.css" rel="stylesheet">
<script src="static/js/jquery-1.7.2.js"></script>
<script src="static/login/js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="static/js/jQuery.md5.js"></script>
<script type="text/javascript" src="static/js/jquery.tips.js"></script>
<script type="text/javascript" src="static/js/jquery.cookie.js"></script>
|
fd0087a8
孙向锦
添加英语语言
|
30
31
32
33
34
35
|
<script type="text/javascript" src="static/js/lang.js"></script>
<script type="text/javascript" >
if(lang() != 'zh'){
}
</script>
|
eef2f078
孙向锦
修改域名问题
|
36
37
38
39
40
41
42
43
44
45
46
47
48
|
<style type="text/css">
.div_foot {
height: 30px;
line-height: 35px;
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
font-family: Arial;
font-size: 14px;
letter-spacing: 1px;
}
</style>
|
ad5081d3
孙向锦
初始化项目
|
49
|
|
eef2f078
孙向锦
修改域名问题
|
50
51
52
|
<!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询(media queries)功能 -->
<!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 -->
<!--[if lt IE 9]>
|
a9f5da51
孙向锦
更换首页
|
53
54
55
|
<script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
|
eef2f078
孙向锦
修改域名问题
|
56
57
58
|
</head>
<body>
<div class="content">
|
a9f5da51
孙向锦
更换首页
|
59
|
<div class="content_t">
|
eef2f078
孙向锦
修改域名问题
|
60
|
<img src="static/login/title.png" alt="SunVote" />
|
ad5081d3
孙向锦
初始化项目
|
61
|
</div>
|
a9f5da51
孙向锦
更换首页
|
62
|
<div class="content_b">
|
eef2f078
孙向锦
修改域名问题
|
63
|
<div class="form_box">
|
2a880654
jack
1、登录界面添加记住密码功能
|
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
<form action="" method="post" name="loginbox" id="loginbox" >
<div class="name_box">
<input type="text" name="loginname" id="loginname" value="" placeholder="用户名" autoComplete="off"/>
<svg t="1554790328236" class="icon_down" style="" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2161" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32"><defs><style type="text/css"></style></defs><path d="M863.321996 251.674996 194.108395 251.674996 528.677333 621.186771Z" p-id="2162" fill="#333333"></path></svg>
</div>
<div class="psw_box">
<input type="password" name="password" id="password" placeholder="密 码" value="" autoComplete="off"/>
<div class="rember">
<input type="checkbox" id="rem_flag"/>
<span>记住密码</span>
</div>
</div>
<a href="#" onclick="severCheck();" class="login_btn">登录</a>
<div class="history">
<ul>
</ul>
</div>
|
eef2f078
孙向锦
修改域名问题
|
83
|
</form>
|
ad5081d3
孙向锦
初始化项目
|
84
|
|
eef2f078
孙向锦
修改域名问题
|
85
86
87
88
89
90
|
</div>
</div>
<div class="div_foot">
©长沙中天电子设计开发有限公司版权所有. 备案许可证号: <a target= "_blank" href="http://www.miitbeian.gov.cn/">湘ICP备09025927号-10</a>
</div>
<script type="text/javascript">
|
a9f5da51
孙向锦
更换首页
|
91
|
|
3371dbc6
孙向锦
0720 版本
|
92
93
94
|
if(window.top != window.self){
window.top.location.href = "<%=basePath%>";
}
|
d318653d
=
1、登录页添加回车交互
|
95
96
97
98
99
100
101
102
103
|
document.onkeydown = function (e) { // 回车提交表单
// 兼容FF和IE和Opera
var theEvent = window.event || e;
var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
if (code == 13) {
severCheck();
}
}
|
2a880654
jack
1、登录界面添加记住密码功能
|
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
|
$(".icon_down").click(function(){
$("#loginname").focus();
});
$("#loginname").focus(function(){
var _html="";
var u_list=JSON.parse(storage.getItem('userNameList'));
for(var i=0;i<u_list.length;i++){
_html+='<li>'+u_list[i]+'</li>';
}
$(".history ul").html(_html);
$(".history").toggle();
});
$(document).on('hover','.history li',function(){
var p_list=JSON.parse(storage.getItem('passWordList'));
$("#loginname").val($(this).text());
$("#password").val(p_list[$(this).index()]);
//$(".history").hide();
})
$("#loginname").blur(function(){
$(".history").hide();
})
|
a9f5da51
孙向锦
更换首页
|
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
//客户端校验
function check() {
if ($("#loginname").val() == "") {
$("#loginname").tips({
side : 2,
msg : '用户名不得为空',
bg : '#AE81FF',
time : 3
});
showfh();
$("#loginname").focus();
return false;
} else {
$("#loginname").val(jQuery.trim($('#loginname').val()));
}
if ($("#password").val() == "") {
$("#password").tips({
side : 2,
msg : '密码不得为空',
bg : '#AE81FF',
time : 3
});
showfh();
$("#password").focus();
return false;
}
$("#loginbox").tips({
side : 1,
msg : '正在登录 , 请稍后 ...',
bg : '#68B500',
time : 10
});
return true;
}
|
ad5081d3
孙向锦
初始化项目
|
169
170
171
172
173
|
//服务器校验
function severCheck(){
if(check()){
var loginname = $("#loginname").val();
var password = $("#password").val();
|
81df8ce6
孙向锦
去掉多余的信息
|
174
|
var code = loginname+";;;"+password+";;;" + $("#code").val();
|
ad5081d3
孙向锦
初始化项目
|
175
176
177
178
179
180
181
182
|
$.ajax({
type: "POST",
url: 'login_login',
data: {KEYDATA:code,tm:new Date().getTime()},
dataType:'json',
cache: false,
success: function(data){
if("success" == data.result){
|
2a880654
jack
1、登录界面添加记住密码功能
|
183
184
|
if($("#rem_flag").prop("checked")) //如果选择了记住密码
saveCookie();
|
338594c8
孙向锦
添加教师端页面
|
185
186
|
if(data.teacher != null){
window.location.href="main/teacher";
|
6b3a5ad0
孙向锦
添加管理员界面
|
187
188
|
}else if(data.admin != null){
window.location.href="main/admin";
|
338594c8
孙向锦
添加教师端页面
|
189
190
191
|
}else{
window.location.href="main/index";
}
|
ad5081d3
孙向锦
初始化项目
|
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
}else if("usererror" == data.result){
$("#loginname").tips({
side : 1,
msg : "用户名或密码有误",
bg : '#FF5080',
time : 15
});
showfh();
$("#loginname").focus();
}else if("codeerror" == data.result){
$("#code").tips({
side : 1,
msg : "验证码输入有误",
bg : '#FF5080',
time : 15
});
showfh();
$("#code").focus();
}else{
$("#loginname").tips({
side : 1,
msg : "缺少参数",
bg : '#FF5080',
time : 15
});
showfh();
$("#loginname").focus();
}
}
});
}
}
|
a9f5da51
孙向锦
更换首页
|
224
|
|
2a880654
jack
1、登录界面添加记住密码功能
|
225
226
227
228
229
230
|
var storage=window.localStorage;
var userNameList=[];
var passWordList=[];
//console.log(JSON.parse(storage.getItem('userNameList')));
|
ad5081d3
孙向锦
初始化项目
|
231
|
function saveCookie() {
|
2a880654
jack
1、登录界面添加记住密码功能
|
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
|
if(!window.localStorage){
alert("浏览器不支持localstorage");
}else{
//主逻辑业务
userNameList=JSON.parse(storage.getItem('userNameList'));
passWordList=JSON.parse(storage.getItem('passWordList'));
if(userNameList==null){
var userNameList=[];
var passWordList=[];
userNameList.push($("#loginname").val());
passWordList.push($("#password").val());
storage.setItem('userNameList',JSON.stringify(userNameList));
storage.setItem('passWordList',JSON.stringify(passWordList));
}else{
if(userNameList.indexOf($("#loginname").val())>-1){
return false;
}else{
userNameList.push($("#loginname").val());
passWordList.push($("#password").val());
storage.setItem('userNameList',JSON.stringify(userNameList));
storage.setItem('passWordList',JSON.stringify(passWordList));
}
}
//console.log(userNameList);
}
/*$.cookie('loginname', $("#loginname").val(), {
|
ad5081d3
孙向锦
初始化项目
|
271
272
273
274
|
expires : 7
});
$.cookie('password', $("#password").val(), {
expires : 7
|
2a880654
jack
1、登录界面添加记住密码功能
|
275
276
|
});*/
|
ad5081d3
孙向锦
初始化项目
|
277
|
}
|
ad5081d3
孙向锦
初始化项目
|
278
|
</script>
|
eef2f078
孙向锦
修改域名问题
|
279
280
281
282
283
284
285
286
287
288
289
|
<script type="text/javascript"
src="static/login/js/jquery-1.5.1.min.js"></script>
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<script
src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="static/login/js/bootstrap.min.js"></script>
<script src="static/js/jquery-1.7.2.js"></script>
<script src="static/login/js/jquery.easing.1.3.js"></script>
<script src="static/login/js/jquery.mobile.customized.min.js"></script>
<script src="static/login/js/camera.min.js"></script>
<script src="static/login/js/templatemo_script.js"></script>
|
eef2f078
孙向锦
修改域名问题
|
290
291
292
293
294
295
296
297
298
299
|
<script type="text/javascript" src="static/js/jQuery.md5.js"></script>
<script type="text/javascript" src="static/js/jquery.tips.js"></script>
<script type="text/javascript" src="static/js/jquery.cookie.js"></script>
<!-- 软键盘控件start -->
<script type="text/javascript"
src="static/login/keypad/js/form/keypad.js"></script>
<script type="text/javascript"
src="static/login/keypad/js/framework.js"></script>
</body>
|
ad5081d3
孙向锦
初始化项目
|
300
|
</html>
|