From 76126b05d147820acd8c389523e50102726911f1 Mon Sep 17 00:00:00 2001 From: zhangpeihang <948869991@qq.com> Date: Mon, 28 Feb 2022 21:24:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20EFCore=20=E5=88=9B?= =?UTF-8?q?=E5=BB=BA=E7=94=A8=E6=88=B7=E6=97=B6=E4=B8=8D=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E8=A7=92=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BootstrapAdmin.DataAccess.EFCore/Services/UserService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/Services/UserService.cs b/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/Services/UserService.cs index c8899152..2660df57 100644 --- a/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/Services/UserService.cs +++ b/src/blazor/admin/BootstrapAdmin.DataAccess.EFCore/Services/UserService.cs @@ -306,6 +306,7 @@ public class UserService : IUser Password = pwd }; dbcontext.Add(user); + ret = dbcontext.SaveChanges() > 0; // 授权 Default 角色 dbcontext.Database.ExecuteSqlRaw("insert into UserRole (UserID, RoleID) select ID, (select ID from Roles where RoleName = 'Default') RoleId from Users where UserName = {0}", userName); ret = dbcontext.SaveChanges() > 0;