login.jsp 3.8 KB
<%@ 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;">&nbsp;郑州机场航空物流信息平台</div>
    </div>
    <div class="login_box">
        <input class="admin" type="text" placeholder="请输入账号" id="userName" maxlength="30" />
        <input class="passWord" type="password" placeholder="请输入密码" id="password" maxlength="30" />
        <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();
        }
    }
</script>
</html>