mirror of https://github.com/abpframework/abp.git
5 changed files with 39 additions and 19 deletions
@ -1,16 +0,0 @@ |
|||
@page "/counter" |
|||
|
|||
<h1>Counter</h1> |
|||
|
|||
<p>Current count: @currentCount</p> |
|||
|
|||
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button> |
|||
|
|||
@code { |
|||
private int currentCount = 0; |
|||
|
|||
private void IncrementCount() |
|||
{ |
|||
currentCount++; |
|||
} |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
@page "/role-management" |
|||
@attribute [Authorize] |
|||
@using Volo.Abp.Identity |
|||
@using Microsoft.AspNetCore.Authorization |
|||
@using Volo.Abp.Application.Dtos |
|||
@inject IIdentityRoleAppService RoleAppService |
|||
|
|||
<h1>Role Management</h1> |
|||
|
|||
<button class="btn btn-primary" @onclick="GetRolesAsync">Get role list</button> |
|||
|
|||
@if (_roles != null) |
|||
{ |
|||
<ul class="mt-2"> |
|||
@foreach (var role in _roles) |
|||
{ |
|||
<li>@role.Id / @role.Name</li> |
|||
} |
|||
</ul> |
|||
<p>Total role count: @_totalRoleCount</p> |
|||
} |
|||
|
|||
@code { |
|||
private long _totalRoleCount = 0; |
|||
private IReadOnlyList<IdentityRoleDto> _roles; |
|||
|
|||
private async Task GetRolesAsync() |
|||
{ |
|||
var result = await RoleAppService.GetListAsync(new PagedAndSortedResultRequestDto()); |
|||
_totalRoleCount = result.TotalCount; |
|||
_roles = result.Items; |
|||
} |
|||
} |
|||
Loading…
Reference in new issue