diff --git a/Src/Dlhis.Sys/Identity/Services/Implements/UserService.cs b/Src/Dlhis.Sys/Identity/Services/Implements/UserService.cs index 55877e73..3b79a260 100644 --- a/Src/Dlhis.Sys/Identity/Services/Implements/UserService.cs +++ b/Src/Dlhis.Sys/Identity/Services/Implements/UserService.cs @@ -12,11 +12,9 @@ public class UserService : IUserService { private readonly IDbContext _dbContext; - public UserService(IDbContext dbContext, IConfiguration configuration) + public UserService(IDbContext dbContext) { - var identityConnection = configuration.GetSection("SqlSugarOptions:IdentityConnectionString").Value; - dbContext.Client.CurrentConnectionConfig.ConnectionString = identityConnection; - _dbContext = dbContext; + _dbContext = dbContext.ChangeDb("identity"); } public async Task> GetPageAsync(UserPageRequest request) diff --git a/Src/Dlhis.Sys/SqlSugarPack.cs b/Src/Dlhis.Sys/SqlSugarPack.cs index 9458f466..98f4153a 100644 --- a/Src/Dlhis.Sys/SqlSugarPack.cs +++ b/Src/Dlhis.Sys/SqlSugarPack.cs @@ -16,7 +16,7 @@ public class SqlSugarPack : BaseAppPack return new List { - new ConnectionConfig + new() { ConfigId = "identity",