login.jsp
4.6 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
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>郑州机场航空物流信息平台</title>
<link href="<%=basePath %>resource/css/login.css" rel="stylesheet">
<script src="<%=basePath %>resource/easyui/jquery.min.js"></script>
<script type="text/javascript" src="<%=basePath %>resource/layer-v3.0.3/layer/layer.js"></script>
</head>
<body>
<div id="login">
<div style="height: 83px;margin-top: 32px;">
<div style="font-size:28px;color:white;margin-left:400px;">河南省机场集团有限公司</div>
<div style="font-size:16px;color:white;margin-left:510px;"> 郑州机场航空物流信息平台</div>
</div>
<div class="login_box">
<input class="admin" type="text" placeholder="请输入账号" id="userName" maxlength="30" />
<input class="passWord" type="password" placeholder="请输入密码" id="password" onblur="regularValue()" maxlength="30" />
<%--<input type="text" name="valida" id="valida" οnkeydοwn="doEnter();">--%>
<%--<span><img src="<%=basePath %>verify/code" id="imgValida" οnclick="this.src='<%=basePath %>verify/code?a='+Math.random()" class="imgValida"></span>--%>
<input class="submit" type="button" onclick="doLogin()"/>
<a style="text-decoration:none;display:inline-block;
color:#fff;left:30%;position:relative;
font-size:20px;margin:0px auto;"
href="http://www.zzcargo.com/index.php?r=site/signup">注册</a>
<div class="clear">
</div>
</div>
</div>
<div id="copyright"></div>
</body>
<script type="text/javascript">
function login(){
$.ajax({
url:"<%=basePath %>manifest/cross/grid.json",
data:{
page:1,
rows : 10
},
success:function(data){
/* console.log("login()-->"+JSON.stringify(data)); */
}
});
}
login();
function doLogin(){
var userName = $("#userName").val();
var password = $("#password").val();
if(userName==''){
$("#userName").focus();
layer.tips('请输入用户名', '#userName', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
//layer.open({content:"请输入用户名"});
return false;
}
else if(password==''){
$("#password").focus();
layer.tips('请输入密码', '#password', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}else{
jQuery.post("<%=basePath %>doLogin",{loginAccount:userName,password:password},function(result){
if (result.status == 201){
$("#userName").focus();
layer.tips('用户名已被禁用请联系管理员', '#userName', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
} else{
if(result.status == 200){
sessionStorage.removeItem("menuid");
window.location.href="<%=basePath %>index";
}else{
if(result.msg==1) {
$("#password").val("");
$("#userName").focus();
layer.tips('用户名或密码错误', '#userName', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
}
}
}
},"json");
}
}
$(function(){
document.onkeydown = keyDown;
});
//回车登录事件
function keyDown(){
if (event.keyCode == 13){
event.returnValue=false;
event.cancel = true;
doLogin();
}
}
function regularValue() {
var passwords = $("#newpassword").val();
var reg = /^(?![A-Za-z0-9]+$)(?![a-z0-9\W]+$)(?![A-Za-z\W]+$)(?![A-Z0-9\W]+$)[a-zA-Z0-9\W]{8,}$/;
var re = new RegExp(reg);
if (re.test(passwords)){
return true;
}else {
//不符合规则
layer.tips('您的密码过于简单请及时修改', '#userName', {
tips: [1, '#0FA6D8'] //还可配置颜色
});
return false;
}
}
</script>
</html>