From 7e923d16c208966f366cea6eec3e409fe5cf5c7d Mon Sep 17 00:00:00 2001 From: YouWeiDH Date: Sat, 12 Oct 2024 10:25:17 +0800 Subject: [PATCH] hdong:fix some bug for register again when fail. --- .../BotSharp.Core/Users/Services/UserService.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs b/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs index 5adfd668..5dc16b85 100644 --- a/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs +++ b/src/Infrastructure/BotSharp.Core/Users/Services/UserService.cs @@ -54,7 +54,14 @@ public class UserService : IUserService if (string.IsNullOrEmpty(user.Id)) { - user.Id = Guid.NewGuid().ToString(); + if (hasRegisterId != null) + { + user.Id = hasRegisterId; + } + else + { + user.Id = Guid.NewGuid().ToString(); + } } record = user;