<%@ Page Language="C#" AutoEventWireup="true" %>

<%--
1  验证成功    
2  账号不存在     
3  密码错误     
4  登录受限   
5  其他   
--%>
<script runat="server">
    protected override void OnError(EventArgs e)
    {
        Server.ClearError();
        Response.Clear();
        Response.Write("5");
    }
    protected override void OnInit(EventArgs e)
    {
        string acc = Request.Params["acc"];
        if (string.IsNullOrEmpty(acc))
        {
            Response.Clear();
            Response.Write("2");//账号不存在
            return;
        }
        string pwd = Request.Params["pwd"];
        if (string.IsNullOrEmpty(pwd))
        {
            Response.Clear();
            Response.Write("3");//密码错误
            return;
        }
        com.xykj.business.View.Account.User _user = new com.xykj.business.View.Account.User();
        var user = _user.GetUserByAccount(acc);
        if (user == null)
        {
            Response.Clear();
            Response.Write("2");//账号不存在
            return;
        }
        if (!string.Equals(user.Password, pwd, StringComparison.OrdinalIgnoreCase))
        {
            Response.Clear();
            Response.Write("3");//密码错误
            return;
        }
        if (user.isdelete)
        {
            Response.Clear();
            Response.Write("4");//登录受限
            return;
        }
        if (user.State != 200)
        {
            Response.Clear();
            Response.Write("4");//登录受限
            return;
        }
        Response.Clear();
        Response.Write("1");
    }
</script>
