From aea0896356e616ab0568891591a15853e9907683 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Sun, 10 Nov 2024 17:23:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DGetUserAsync?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Managers/UserMessageManager.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Yi.Abp.Net8/module/chat-hub/Yi.Framework.ChatHub.Domain/Managers/UserMessageManager.cs b/Yi.Abp.Net8/module/chat-hub/Yi.Framework.ChatHub.Domain/Managers/UserMessageManager.cs index 06d2a9ad..7bfc47dd 100644 --- a/Yi.Abp.Net8/module/chat-hub/Yi.Framework.ChatHub.Domain/Managers/UserMessageManager.cs +++ b/Yi.Abp.Net8/module/chat-hub/Yi.Framework.ChatHub.Domain/Managers/UserMessageManager.cs @@ -78,7 +78,12 @@ namespace Yi.Framework.ChatHub.Domain.Managers public async Task GetUserAsync(Guid userId) { var key = new ChatOnlineUserCacheKey(CacheKeyPrefix); - var cacheUser = System.Text.Json.JsonSerializer.Deserialize(await RedisClient.HGetAsync(key.GetKey(), key.GetField(userId))); + var cacheUserOrNull= await RedisClient.HGetAsync(key.GetKey(), key.GetField(userId)); + if (cacheUserOrNull is null) + { + return null; + } + var cacheUser = System.Text.Json.JsonSerializer.Deserialize(cacheUserOrNull); return cacheUser; } } From 17bc4ade84aa547974992411cb67d03849b0f4eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A9=99=E5=AD=90?= <454313500@qq.com> Date: Sun, 10 Nov 2024 17:33:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AE=A1=E8=AE=A1?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs b/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs index 696d0f74..8228608d 100644 --- a/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs +++ b/Yi.Abp.Net8/src/Yi.Abp.Web/YiAbpWebModule.cs @@ -75,8 +75,8 @@ namespace Yi.Abp.Web { //默认关闭,开启会有大量的审计日志 optios.IsEnabled = true; - //审计日志过滤器 - optios.AlwaysLogSelectors.Add(x => Task.FromResult(!x.Url.StartsWith("/api/app/file/"))); + //审计日志过滤器,符合条件的才记录 + optios.AlwaysLogSelectors.Add(x => Task.FromResult(x.Url is null?true:!x.Url.StartsWith("/api/app/file/"))); }); //采用furion格式的规范化api,默认不开启,使用abp优雅的方式