Exemple #1
0
        // 修改密码
        public void ChangePassword(string oldpwd, string newpwd)
        {
            Account account = sessionService.GetAccount();

            if (passwordService.ComparePassword(oldpwd, account.PassWord))
            {
                account.PassWord = passwordService.CreateDbPassword(newpwd);
                Commit();
            }
            else
            {
                throw new Exception("旧密码错误!");
            }
        }
Exemple #2
0
        //证
        public bool Verify(string username, string password)
        {
            var account = GetOneAccount(AccountIdentifier.of(username));

            return(passwordService.ComparePassword(password, account.PassWord));
        }