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 "恭喜你已注册成功意社区账号!";