diff --git a/src/Shentun.Peis.Domain/CacheService.cs b/src/Shentun.Peis.Domain/CacheService.cs index 84d7024..4e9ed13 100644 --- a/src/Shentun.Peis.Domain/CacheService.cs +++ b/src/Shentun.Peis.Domain/CacheService.cs @@ -203,7 +203,11 @@ namespace Shentun.Peis var userExtension = (IdentityUserWithExtensionDto)_userExtensionCache.Get(cacheKey); if (userExtension == null) { - var userEntity = await _userRepository.GetAsync(o => o.Id == id); + var userEntity = await _userRepository.FirstOrDefaultAsync(o => o.Id == id); + if (userEntity == null) + { + return ""; + } var userSign = userEntity.GetProperty("user_sign"); var userPhoto = userEntity.GetProperty("user_photo"); userExtension = new IdentityUserWithExtensionDto