修改BUG:MongoDB数据库登录用户名区分大小写

This commit is contained in:
Argo-Surface 2019-02-18 15:16:10 +08:00
parent 8a6385b5a4
commit 4201568f2b
1 changed files with 1 additions and 1 deletions

View File

@ -47,7 +47,7 @@ namespace Bootstrap.DataAccess.MongoDB
{
if (string.IsNullOrEmpty(userName) && string.IsNullOrEmpty(password)) return false;
var u = DbManager.Users.Find(user => user.UserName == userName).FirstOrDefault();
var u = DbManager.Users.Find(user => user.UserName.Equals(userName, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
return !string.IsNullOrEmpty(u.PassSalt) && u.Password == LgbCryptography.ComputeHash(password, u.PassSalt);
}