fix: using IsNullOrWhiteSpace

This commit is contained in:
AnonymousDotNet 2024-11-12 10:03:20 +08:00
parent 6f323018d8
commit 4142e99b31

View file

@ -22,7 +22,7 @@ public partial class MongoRepository
string phoneSecond = phone.StartsWith("+86") ? phone.Replace("+86", "") : $"+86{phone}";
var user = _dc.Users.AsQueryable().FirstOrDefault(x => (x.Phone == phone || x.Phone == phoneSecond) && x.Type != UserType.Affiliate && (x.RegionCode == regionCode || x.RegionCode == null));
var user = _dc.Users.AsQueryable().FirstOrDefault(x => (x.Phone == phone || x.Phone == phoneSecond) && x.Type != UserType.Affiliate && (x.RegionCode == regionCode || string.IsNullOrWhiteSpace(x.RegionCode)));
return user != null ? user.ToUser() : null;
}