Skip to content

Commit

Permalink
fix: change user clear data;
Browse files Browse the repository at this point in the history
      update user claims api
  • Loading branch information
Qinyouzeng committed Jun 20, 2024
1 parent 8427615 commit 4c0fc3f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ public async Task<Dictionary<string, string>> GetUserClaimAsync(Guid userId)

public async Task<List<UserClaimDto>> GetClaimsAsync()
{
return (await Caller.GetAsync<PaginatedListBase<UserClaimDto>>($"{RootPath}/sso/userClaim/getlist?page=1&pageSize=100")).Result;
return (await Caller.GetAsync<UserClaimPageDto>($"{RootPath}/sso/userClaim/getlist?page=1&pageSize=100")).Items;
}
}
7 changes: 7 additions & 0 deletions src/Contracts/Masa.Tsc.Contracts.Admin/User/UserClaimDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@

namespace Masa.Tsc.Contracts.Admin.User;

public class UserClaimPageDto
{
public int Total { get; set; }

public List<UserClaimDto> Items { get; }
}

public class UserClaimDto
{
public Guid Id { get; set; }
Expand Down
5 changes: 5 additions & 0 deletions src/Web/Masa.Tsc.Web.Admin.Rcl/Pages/App/Index.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,15 @@ private bool IsSearchKeyword(object value)

private async Task UserChange(Guid userId)
{
if (_userId == userId)
return;
currentLog = default;
currentTrace = default;
_userId = userId;
if (roles == null)
roles = await ApiCaller.UserService.GetUserRolesAsync(userId);
user = await ApiCaller.UserService.GetUserDetailAsync(userId);

var claims = await ApiCaller.UserService.GetUserClaimAsync(userId);
var claimTypes = await ApiCaller.UserService.GetClaimsAsync();
if (claims != null && claims.Count > 0 && claimTypes != null && claimTypes.Count > 0)
Expand Down

0 comments on commit 4c0fc3f

Please sign in to comment.