fix 更新登陆信息

This commit is contained in:
2024-06-05 18:13:29 +08:00
parent 73d8d67504
commit ac0ab2bb00
2 changed files with 3 additions and 2 deletions

View File

@@ -93,6 +93,7 @@ public class UsersController : ControllerBase
/// </summary>
/// <param name="request"></param>
[Transactional]
[Authorize]
[HttpPost("reloginInfo")]
public async Task ResetLoginTenantAsync(UserResetLoginTenantRequest request)
{

View File

@@ -145,14 +145,14 @@ public class UserService : IUserService
var userId = _currentUser.GetIntSubjectId();
await _dbContext.Updateable<UserClaimEntity>()
await _identityDbContext.Updateable<UserClaimEntity>()
.SetColumns(x => x.ClaimValue == request.Tenant)
.Where(x => x.UserId == userId)
.Where(x => x.ClaimType == "tenant")
.ExecuteCommandAsync();
var tenantStr = tenants.Select(x => x.Code).Join(",");
await _dbContext.Updateable<UserClaimEntity>()
await _identityDbContext.Updateable<UserClaimEntity>()
.SetColumns(x => x.ClaimValue == tenantStr)
.Where(x => x.UserId == userId)
.Where(x => x.ClaimType == "tenants")