Exemple #1
0
        public ActionResult Login(Domain.SYS_USER item)
        {
            var json = new JsonHelper()
            {
                Msg = "登录成功", Status = "n"
            };

            try
            {
                //调用登录验证接口 返回用户实体类
                var users = UserManage.UserLogin(item.ACCOUNT.Trim(), item.PASSWORD.Trim());
                if (users != null)
                {
                    //是否锁定
                    if (users.ISCANLOGIN == 1)
                    {
                        json.Msg = "用户已锁定,禁止登录,请联系管理员进行解锁";
                        //log4net.
                        return(Json(json));
                    }
                    json.Status = "y";
                }
                else
                {
                    json.Msg = "用户名或密码不正确";
                }
            }
            catch (Exception e)
            {
                json.Msg = e.Message;
            }
            return(Json(json, JsonRequestBehavior.AllowGet));
        }