efdefb1b
孙向锦
添加语言English
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
<%@ 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>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
|
1f1e41d5
jack
去除中天(sunvote)等字样
|
17
|
<title>Education Management System</title>
|
efdefb1b
孙向锦
添加语言English
|
18
19
|
<!-- Bootstrap -->
|
54a5b6ad
jack
1.英文翻译
|
20
|
<link href="static/css/bootstrap.min.css" rel="stylesheet">
|
efdefb1b
孙向锦
添加语言English
|
21
|
<link href="static/login/style_login.css" rel="stylesheet">
|
54a5b6ad
jack
1.英文翻译
|
22
|
<link href="static/css/mb_style.css" rel="stylesheet">
|
efdefb1b
孙向锦
添加语言English
|
23
|
|
54a5b6ad
jack
1.英文翻译
|
24
25
|
<script src="static/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="static/js/jquery.cookie.js"></script>
|
efdefb1b
孙向锦
添加语言English
|
26
27
28
|
<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>
|
efdefb1b
孙向锦
添加语言English
|
29
|
<script type="text/javascript" src="static/js/lang.js"></script>
|
b638e17a
jack
1.英文翻译(三)
|
30
|
<script type="text/javascript" src="static/js/en_remove.js"></script>
|
efdefb1b
孙向锦
添加语言English
|
31
32
33
34
35
36
|
<script type="text/javascript" >
if(lang() != 'en'){
}
</script>
<style type="text/css">
|
54a5b6ad
jack
1.英文翻译
|
37
38
39
40
|
html,body{
padding:0;
margin:0;
}
|
efdefb1b
孙向锦
添加语言English
|
41
42
43
44
45
46
47
48
49
50
51
|
.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;
}
|
54a5b6ad
jack
1.英文翻译
|
52
53
54
55
56
57
58
59
60
|
.clear_history{
text-align:right;
line-height:30px;
margin: 0;
}
.clear_history a{
text-decoration: underline;
margin-right: 15px;
}
|
efdefb1b
孙向锦
添加语言English
|
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
</style>
<!-- HTML5 shim 和 Respond.js 是为了让 IE8 支持 HTML5 元素和媒体查询(media queries)功能 -->
<!-- 警告:通过 file:// 协议(就是直接将 html 页面拖拽到浏览器中)访问页面时 Respond.js 不起作用 -->
<!--[if lt IE 9]>
<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]-->
</head>
<body>
<div class="content">
<div class="content_t">
<img src="static/login/en_title.png" alt="SunVote" />
</div>
<div class="content_b">
<div class="form_box">
|
54a5b6ad
jack
1.英文翻译
|
77
78
79
80
81
82
83
84
85
86
|
<div id="loginbox" >
<div class="name_box">
<input type="text" id="loginname" value="" placeholder="Username" 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="text" id="password" placeholder="Password" value="" autoComplete="off"/>
<div class="rember" style="width:50%;float:left;text-align:left;margin-top:10px;display:inline-block;line-height:34px;">
<input type="checkbox" id="rem_flag"/>
|
b638e17a
jack
1.英文翻译(三)
|
87
|
<span>Remember me</span>
|
54a5b6ad
jack
1.英文翻译
|
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
</div>
<div class="language" style="display:inline-block;width:50%;margin-top:10px;text-align:right;">
<select name="language" id="language" style="line-height:34px;height:34px;width:120px;">
<option value="en">English</option>
<option value="zh">中文</option>
</select>
</div>
</div>
<a href="#" onclick="severCheck();" class="login_btn">Login</a>
<div class="history">
<ul>
</ul>
<p class="clear_history"><a onclick="clear_history()">Clear</a></p>
</div>
</div>
|
efdefb1b
孙向锦
添加语言English
|
105
106
107
108
|
</div>
</div>
<div class="div_foot">
|
1f1e41d5
jack
去除中天(sunvote)等字样
|
109
|
Record License No. <a target= "_blank" href="http://www.miitbeian.gov.cn/">湘ICP备09025927号-10</a>
|
efdefb1b
孙向锦
添加语言English
|
110
111
112
113
114
115
|
</div>
<script type="text/javascript">
if(window.top != window.self){
window.top.location.href = "<%=basePath%>";
}
|
54a5b6ad
jack
1.英文翻译
|
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
document.onkeydown = function (e) { // 回车提交表单
// 兼容FF和IE和Opera
var theEvent = window.event || e;
var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
if (code == 13) {
severCheck();
}
}
$(".icon_down").click(function(){
$("#loginname").focus();
});
$("#loginname").focus(function(e){
$("#password").attr("type","password");
var _html="";
var u_list=JSON.parse(storage.getItem('userNameList'));
console.log(u_list);
if((u_list!=null)||(u_list.length>0)){
$("#loginname").blur(function(){
$(".history").hide();
})
for(var i=0;i<u_list.length;i++){
_html+='<li>'+u_list[i]+'</li>';
}
$(".history ul").html(_html);
$(".history").show();
}
});
$('.history').hover(function(){ //鼠标悬停下拉框时,解绑blur事件
$("#loginname").unbind("blur");
},function(){
$("#loginname").blur(function(){ //鼠标移出下拉框时,添加blur事件
$(".history").hide();
})
});
$(document).on('click','.history li',function(){
var p_list=JSON.parse(storage.getItem('passWordList'));
$("#loginname").val($(this).text());
$("#password").val(p_list[$(this).index()]);
$(".history").hide();
})
//更换语言
$("#language").change(function(){
$.cookie("lang",$("#language").val());
window.location.reload();
})
console.log($.cookie("lang"));
|
efdefb1b
孙向锦
添加语言English
|
172
173
174
175
176
177
|
//客户端校验
function check() {
if ($("#loginname").val() == "") {
$("#loginname").tips({
side : 2,
|
b638e17a
jack
1.英文翻译(三)
|
178
|
msg : 'User name must not be empty',
|
efdefb1b
孙向锦
添加语言English
|
179
180
181
182
183
184
185
186
187
188
189
190
|
bg : '#AE81FF',
time : 3
});
showfh();
$("#loginname").focus();
return false;
} else {
$("#loginname").val(jQuery.trim($('#loginname').val()));
}
if ($("#password").val() == "") {
$("#password").tips({
side : 2,
|
b638e17a
jack
1.英文翻译(三)
|
191
|
msg : 'Password must not be empty',
|
efdefb1b
孙向锦
添加语言English
|
192
193
194
195
196
197
198
199
200
201
|
bg : '#AE81FF',
time : 3
});
showfh();
$("#password").focus();
return false;
}
$("#loginbox").tips({
side : 1,
|
b638e17a
jack
1.英文翻译(三)
|
202
|
msg : 'Logging in, please wait a moment ...',
|
efdefb1b
孙向锦
添加语言English
|
203
204
205
206
207
208
|
bg : '#68B500',
time : 10
});
return true;
}
|
54a5b6ad
jack
1.英文翻译
|
209
210
|
|
efdefb1b
孙向锦
添加语言English
|
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
|
//服务器校验
function severCheck(){
if(check()){
var loginname = $("#loginname").val();
var password = $("#password").val();
var code = loginname+";;;"+password+";;;" + $("#code").val();
$.ajax({
type: "POST",
url: 'login_login',
data: {KEYDATA:code,tm:new Date().getTime()},
dataType:'json',
cache: false,
success: function(data){
if("success" == data.result){
|
54a5b6ad
jack
1.英文翻译
|
226
227
|
if($("#rem_flag").prop("checked")) //如果选择了记住密码
saveCookie();
|
efdefb1b
孙向锦
添加语言English
|
228
229
230
231
232
233
234
235
236
237
|
if(data.teacher != null){
window.location.href="main/teacher";
}else if(data.admin != null){
window.location.href="main/admin";
}else{
window.location.href="main/index";
}
}else if("usererror" == data.result){
$("#loginname").tips({
side : 1,
|
b638e17a
jack
1.英文翻译(三)
|
238
|
msg : "Error in username or password",
|
efdefb1b
孙向锦
添加语言English
|
239
240
241
242
243
244
245
246
|
bg : '#FF5080',
time : 15
});
showfh();
$("#loginname").focus();
}else if("codeerror" == data.result){
$("#code").tips({
side : 1,
|
b638e17a
jack
1.英文翻译(三)
|
247
|
msg : "Error in input of validation code",
|
efdefb1b
孙向锦
添加语言English
|
248
249
250
251
252
253
254
255
|
bg : '#FF5080',
time : 15
});
showfh();
$("#code").focus();
}else{
$("#loginname").tips({
side : 1,
|
b638e17a
jack
1.英文翻译(三)
|
256
|
msg : "Lack of parameters",
|
efdefb1b
孙向锦
添加语言English
|
257
258
259
260
261
262
263
264
265
266
267
|
bg : '#FF5080',
time : 15
});
showfh();
$("#loginname").focus();
}
}
});
}
}
|
54a5b6ad
jack
1.英文翻译
|
268
269
270
271
272
273
274
275
|
var storage=window.localStorage;
var userNameList=[];
var passWordList=[];
//console.log(JSON.parse(storage.getItem('userNameList')));
//清除历史记录
function clear_history(){
|
b638e17a
jack
1.英文翻译(三)
|
276
|
window.top.remove.init({"title":"Are you sure you want to clear the history?","func":function(success){
|
54a5b6ad
jack
1.英文翻译
|
277
278
279
280
281
282
283
284
285
286
287
|
if(success){
storage.clear();
$(".history").hide();
}else{
console.log("false");
}
}});
window.top.remove.show();
$(".mb_head .close img").css("display","none");
}
//保存登录记录
|
efdefb1b
孙向锦
添加语言English
|
288
|
function saveCookie() {
|
54a5b6ad
jack
1.英文翻译
|
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
|
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(), {
|
efdefb1b
孙向锦
添加语言English
|
328
329
330
331
|
expires : 7
});
$.cookie('password', $("#password").val(), {
expires : 7
|
54a5b6ad
jack
1.英文翻译
|
332
333
|
});*/
|
efdefb1b
孙向锦
添加语言English
|
334
335
|
}
</script>
|
54a5b6ad
jack
1.英文翻译
|
336
337
338
|
|
efdefb1b
孙向锦
添加语言English
|
339
340
341
342
343
344
345
346
|
<!-- 软键盘控件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>
</html>
|