From f9843c13d4624b21f7137e37276958fb0ba95ae0 Mon Sep 17 00:00:00 2001 From: chenchun Date: Fri, 29 Aug 2025 11:34:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E4=B8=BA=E7=A9=BA=E6=97=B6=E7=9A=84=E5=A4=84?= =?UTF-8?q?=E7=90=86=E9=80=BB=E8=BE=91=E5=B9=B6=E8=B0=83=E6=95=B4=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E6=88=90=E5=8A=9F=E7=BC=93=E5=AD=98=E5=86=99=E5=85=A5?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/FuwuhaoService.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/FuwuhaoService.cs b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/FuwuhaoService.cs index 4208d949..a39e7ca6 100644 --- a/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/FuwuhaoService.cs +++ b/Yi.Abp.Net8/module/ai-hub/Yi.Framework.AiHub.Application/Services/FuwuhaoService.cs @@ -101,6 +101,10 @@ public class FuwuhaoService : ApplicationService } var cache = await _sceneCache.GetAsync($"{FuwuhaoConst.SceneCacheKey}{scene}"); + if (cache == null) + { + return "success"; // 跳过直接返回成功 + } //根据操作类型,进行业务处理,返回处理结果,再写入缓存,10s过去,相当于用户10s扫完app后,轮询要在10秒内完成 var scenResult = @@ -228,10 +232,10 @@ public class FuwuhaoService : ApplicationService Nick = userInfo.Nickname, Icon = result.FirstOrDefault()?.Id.ToString() }); - - var sceneCache = await _sceneCache.GetAsync($"{FuwuhaoConst.SceneCacheKey}{scene}"); - sceneCache.SceneResult = SceneResultEnum.Login; - await _sceneCache.SetAsync($"{FuwuhaoConst.SceneCacheKey}:{scene}", sceneCache, + await _sceneCache.SetAsync($"{FuwuhaoConst.SceneCacheKey}:{scene}", new SceneCacheDto + { + SceneResult = SceneResultEnum.Register + }, new DistributedCacheEntryOptions() { AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(50) }); return "恭喜你已注册成功意社区账号!";