<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="Us.Web.admin._default" %>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title><%=AppConfig.sSoftName +"-"+ AppConfig.sSoftCompanyName%></title>
    <link href="login/css/style.css" rel="stylesheet" type="text/css" />
   <script type="text/javascript" src="/admin/js/jquery/jquery-1.12.3.min.js"></script>

<script type="text/javascript" src="/admin/js/Us.Library.V1.js?jsdate=20200403"></script>


<script type="text/javascript" src="/admin/easyui/aridialog/jquery.artDialog.js?skin=default"></script>
<script type="text/javascript" src="/admin/easyui/aridialog/iframeTools.js?jsdate=20200403"></script>
<script type="text/javascript" src="js/SystemAlert.js?jsdate=20200403"></script>

     <script language="javascript" type="text/javascript">
         $(function () {

            $('.loginbox').css({ 'position': 'absolute', 'left': ($(window).width() - 692) / 2 });
            $(window).resize(function () {
                $('.loginbox').css({ 'position': 'absolute', 'left': ($(window).width() - 692) / 2 });
            });

            

        });

        function findpwd() {
            CareffArtOpen3('/admin/extother/userfindinfo.aspx', '忘记用户名或密码', 800, 260);
        }
    </script>
     <script type="text/javascript">
         if (window != top) // 判断当前的window对象是否是top对象
             top.location.href = window.location.href; // 如果不是，将top对象的网址自动导向被嵌入网页的网址
    </script>
    
</head>

<body style="background-color: #1c77ac; background-image: url(/admin/login/images/light.png); background-repeat: no-repeat; background-position: center top; overflow: hidden;">


    <asp:Literal ID="LabScript" runat="server"></asp:Literal>
    <div id="mainBody">
        <div id="cloud1" class="cloud"></div>
        <div id="cloud2" class="cloud"></div>
    </div>


    <div class="logintop">
        <span>欢迎进入<% = AppConfig.sSoftName %></span>
        <ul>
           <%-- <li><a href="mainlogin.aspx"> ← 返回</a></li>--%>
        </ul>
    </div>

    <div class="loginbody">

        <span class="systemlogo"></span>

        <div class="loginbox loginbox1">
            <form id="login" method="post" target="_self" action="default.aspx" runat="server">
                
                <ul>
                    <li>
                        <input name="userid" id="userid" type="text" class="loginuser" value="" /></li>
                    <li>
                        <input name="userpwd" id="userpwd" type="password" class="loginpwd" /></li>
                    <li>
                        <input name="" type="button" class="loginbtn" id="btnsubmit" value="登录" />


                        <label style="display:none"><input name="openwindow" type="checkbox" value="" id="openwindow" />登录后全屏</label>


                    <%--    <label><a href="javascript:findpwd();" class="findpwd">忘记用户名或密码</a></label>--%>
                    </li>
                </ul>

            </form>
        </div>

    </div>



    <div class="loginbm"><%=sCopyRight%></div>

    <script type="text/javascript">

        var sLoginID = '<%=sLoginID %>';
        $(function () {
           
            getSysCode();
            $("#userid").val(sLoginID);
            $("#userid")[0].focus();
            $("#btnsubmit").click(function () { UserLogin(); });
            $("#btnreset").click(function () { UserReset(); });
            //$("#imgcode").attr("src", $("#imgcode").attr("src") + "?");
        });

        function UserLogin() {
          
            var userid, userpwd, usercode;
            userid = $("#userid").val();
            userpwd = $("#userpwd").val();
            usercode = $("#usercode").val();
            usercode = "8888";
            if (userid == "" || userid.length < 3 || userid.length > 16) {
                UsAlert('登录名称不能为空,请输入您的登录名称！');
                $("#userid")[0].focus();
                return false;
            }
            if (userpwd == "" || userpwd.length < 3 || userpwd.length > 16) {
                UsAlert('请输入密码，密码要求3-16位');
                $("#userpwd")[0].focus();
                return false;
            }
            //alert(usercode.length)
            if (usercode.length != 4) {
                UsAlert('请输验证码,验证码要求4位');
                $("#usercode")[0].focus();
                return false;
            }

            var data = JSON.stringify({
                "key": "userlogin",
                "userid": userid,
                "userpwd": userpwd,
                "usercode": usercode,
                "skey": "1"
            });

            //alert(JSON.stringify(data));
            US.HTTP.UsAjaxJSON(US.HTTP.BaseURL, data,
                function (d) {
                    //alert(JSON.stringify(d));
                    if (d.result == 0) {
                        getSysCode();
                        window.open(d.msg, "_self");
                    }
                    else {
                        if (d.result != 1) {
                            getSysCode();
                        }
                        else {
                            $("#userpwd")[0].focus();
                        }
                        UsAlert(d.msg);
                    }
                });
            //alert();

            return false;

        }

        function UserReset() {
            $("#userid").val("");
            $("#userpwd").val("");
            $("#usercode").val("");
        }

        function UsAlert(info) {
            //alert(info);
            CareffArtAlertOne(info);
        }

         

        function getSysCode() {
            //var url = US.HTTP.URLAdd("/admin/basic/syscode.aspx");
            //$("#imgcode").attr("src", url);
        }
</script>
</body>

</html>
