From 2ae6183e7f9acca0b9f9d1e678ace102e669e13f Mon Sep 17 00:00:00 2001 From: chenchun Date: Fri, 29 Aug 2025 14:31:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=98=B2=E6=AD=A2=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E6=84=8F=E7=A4=BE=E5=8C=BA=E8=B4=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/FuwuhaoService.cs | 6 ++++++ 1 file changed, 6 insertions(+) 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 92195f2d..c5d36ad3 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 @@ -226,6 +226,11 @@ public class FuwuhaoService : ApplicationService var result = await _fileService.Post(files); + if (await _userRepository.IsAnyAsync(x=>x.FuwuhaoOpenId==userInfo.OpenId)) + { + throw new UserFriendlyException("你已注册过意社区账号"); + } + var userId = await _accountService.PostSystemRegisterAsync(new RegisterDto { UserName = $"wx{Random.Shared.Next(100000, 999999)}", @@ -235,6 +240,7 @@ public class FuwuhaoService : ApplicationService Nick = userInfo.Nickname, Icon = result.FirstOrDefault()?.Id.ToString() }); + await _userRepository.InsertAsync(new AiUserExtraInfoEntity(userId, userInfo.OpenId)); await _sceneCache.SetAsync($"{FuwuhaoConst.SceneCacheKey}:{scene}", new SceneCacheDto {