Ejemplo n.º 1
0
        public OptResult Login(string Username, string Password, string ip = "")
        {
            Employee user = TableNoTracking().Where(o => o.No == Username && o.EmployeeType == EmployeeTypeEnum.支持员工 && o.State == EmployeeStateEnum.架).FirstOrDefault();

            if (user == null)
            {
                return(new OptResult("帐号不存在"));
            }

            if (user.Password != CryptographyUtils.EncryptString(Password))
            {
                OperateLogBLL.GetInstance().LoginLog("用户登录", "密码不正确", user.Id, user.RealName, ip);
                return(new OptResult("密码不正确"));
            }

            OperateLogBLL.GetInstance().LoginLog("用户登录", "登录成功", user.Id, user.RealName, ip);
            return(new OptResult()
            {
                Data = user, Msg = "登录成功"
            });
        }