1
This commit is contained in:
@@ -12,7 +12,11 @@
|
||||
|
||||
<MudButton OnClick="ExamClick"> 详情 </MudButton>
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Delete" aria-label="delete" />
|
||||
<MudIconButton Icon="@Icons.Custom.Brands.GitHub" OnClick="CheckExam" Color="Color.Primary" aria-label="github" />
|
||||
@if (bteacher)
|
||||
{
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Check" OnClick="CheckExam" Color="Color.Primary" aria-label="github" />
|
||||
}
|
||||
|
||||
<MudIconButton Icon="@Icons.Material.Filled.Favorite" Color="Color.Secondary" aria-label="add to favorite" />
|
||||
</MudButtonGroup>
|
||||
</MudPaper>
|
||||
@@ -21,6 +25,10 @@
|
||||
</MudPaper>
|
||||
|
||||
@code {
|
||||
[CascadingParameter]
|
||||
private Task<AuthenticationState> authenticationStateTask { get; set; }
|
||||
|
||||
private bool bteacher = false;
|
||||
|
||||
[Inject]
|
||||
public NavigationManager navigationManager { get; set; }
|
||||
@@ -45,6 +53,12 @@
|
||||
public string? MaxHeight { get; set; } = "64";
|
||||
|
||||
|
||||
protected override Task OnInitializedAsync()
|
||||
{
|
||||
bteacher = authenticationStateTask.Result.User.IsInRole("Teacher");
|
||||
return base.OnInitializedAsync();
|
||||
}
|
||||
|
||||
private void ExamClick()
|
||||
{
|
||||
navigationManager.NavigateTo($"exam/edit/{AssignmentDto.Id}");
|
||||
|
Reference in New Issue
Block a user