<%--
  Created by IntelliJ IDEA.
  User: dell
  Date: 2017-06-14
  Time: 9:11
  To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8"  pageEncoding="UTF-8"  language="java" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://"
          + request.getServerName() + ":" + request.getServerPort()
          + path ;

%>
<!DOCTYPE HTML >
<html>
<head>
  <title>国际物流信息管理系统123</title>
  <meta charset="UTF-8">
  <link rel="stylesheet" type="text/css"
        href="themes/default/easyui.css">
  <link rel="stylesheet" type="text/css" href="themes/icon.css">
    <!--Test-->
    <link href="themes/style.css" rel='stylesheet' type='text/css' />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="timer Sign In Form,Login Forms,Sign up Forms,Registration Forms,News latter Forms,Elements"./>
    <script type="application/x-javascript">

            function  foces() {//光标定位
                document.getElementById("username").focus();
            };
            function keyLogin(){
                if (event.keyCode==13){  //回车键的键值为13
                    //document.getElementByIdx_x("btnLogin").click(); //调用登录按钮的登录事件

                    if(!$('#username').validatebox('isValid')){
                        $('#username').focus();
                    }else  if(!$('#password').validatebox('isValid')){
                        $('#password').focus();
                    }else {
                        $.ajax({
                            url : 'SysLogin/login.do',
                            type :'post',
                            data :{
                                username :$('#username').val(),
                                password :$('#password').val(),
                            },
                            beforeSend :function () {
                                $.messager.progress({
                                    text:'正在登录中……',
                                });
                            },
                            success:function (data,response,status) {
                                $.messager.progress('close');
                                if (data=='password') {
                                    $.messager.alert('登录失败','密码错误！','warnning',function () {
                                        $('#password').select();
                                    });
                                }else if (data=='username'){
                                    $.messager.alert('登录失败','用户不存在！','warnning',function () {
                                        $('#password').select();
                                    });
                                }else {
                                    location.href = 'SysParent/show.do';
                                }

                            },

                        });
                    }
                }else{

                }
            }

    </script>
    <!--End -->
  <script type="text/javascript" src="js/jquery.min.js"></script>
  <script type="text/javascript" src="js/jquery.easyui.min.js"></script>
  <script type="text/javascript" src="js/login.js"></script>
  <style>

    p {
      height :22px;
      line-height: 22px;
      padding: 10px 0 0 0;
      text-align: center;
    }
    .textbox{
      height:22px;
      padding:0 2px 0 0 ;

    }
  </style>
</head>
<body onkeydown="keyLogin();">
<h1>国际物流信息管理系统</h1>
<div class="app-timer">
    <div class="timer"><img src="pic/timer.png" class="img-responsive" alt="" /></div>
    <form>
        <ul>
            <li>
                <a href="#" class=" icon email"></a>
                <input id="username" type="text" class = "textbox" placeholder="请输入账号"/>
            </li>
            <li>
                <a href="#" class=" icon lock"></a>
                <input id="password" type="password" class = "textbox" placeholder="请输入密码"/>
            </li>
            <div class="clear"></div>


            <div class="submit" id = "btnLogin" >
                <a href="#" class="easyui-linkbutton"  ><span style="font-size: 22px">登录</span></a>

            </div>

            <div class="clear"></div>
            <p><a href="#"></a></p>
        </ul>
    </form>
    <div class="whyt"><p>国际物流信息管理系统<a onclick="foces()" href="#">请登陆</a></p></div>
</div>
<!--start-copyright-->
<div class="copy-right">
    <p>Copyright &copy; 2018  All rights  Reserved |  &nbsp;<a href="#">.山东钢铁集团有限公司.</a></p>
</div>
<!--//end-copyright-->
</body>


</html>
