public OperatorController(ILogger <OperatorController> logger, ContextEntity context) { _logger = logger; this._context = new OperatorRepositoryEntity(context); this._userSave = new OperatorSaveService(_context); this._userList = new OperatorListService(_context); this._clientLogin = new OperatorLoginService(_context); this._userDelete = new OperatorDeleteService(_context); }
/// <summary> /// 登陆进程 /// </summary> /// <param name="account">登陆账号</param> /// <param name="psw">登录密码</param> /// <returns>返回0为登陆成功,-404为账户密码错误,-1为被禁用无法登陆</returns> public static int LoginIn(string account, string psw) { if (CheckAccPsw(account, psw) == true) { OperatorList node = OperatorListService.FindOperatorByID(-1, "", account, 3); if (node.Enable == false) { return(-1); } LoginInfo.Account = account; LoginInfo.DegreeLevel = node.AuthDegree; LoginInfo.OperID = node.OperID; LoginInfo.Name = node.OperName; OperatorListService.ChangeOperator(node.OperID, node.OperName, node.AuthDegree, node.LogInCount + 1, node.LoginAccount, "", true, 3); } else { return(-404); } return(0); }
public void Setup() { this._repository = new FakeOperatorRepository(); this._service = new OperatorListService(_repository); }
/// <summary> /// 检查帐号密码是否匹配 /// </summary> /// <param name="account">需要检查的帐号</param> /// <param name="psw">需要检测的密码</param> /// <returns>true为匹配,false为不匹配</returns> public static bool CheckAccPsw(string account, string psw) { string enpsw = EncryPsw(psw); return(OperatorListService.VailPassword(account, enpsw)); }