
Some checks failed
TechAct / explore-gitea-actions (push) Failing after 13s
- 重构AppMainStruct、AssignmentQuestion、Question等实体模型 - 更新相关DTO以匹配新的数据结构 - 优化前端页面布局和组件 - 添加全局信息和笔记功能相关代码 - 更新数据库迁移和程序配置
32 lines
733 B
Plaintext
32 lines
733 B
Plaintext
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication
|
|
@inject NavigationManager Navigation
|
|
@inject IAuthenticationClientService AuthenticationClientService
|
|
|
|
<AuthorizeView>
|
|
<Authorized>
|
|
<MudText>
|
|
Hello, @context.User.Identity.Name!
|
|
</MudText>
|
|
<MudButton OnClick="Logout"> LOGOUT </MudButton>
|
|
</Authorized>
|
|
<NotAuthorized>
|
|
<MudButton Class="" Href="Login"> Login </MudButton>
|
|
</NotAuthorized>
|
|
</AuthorizeView>
|
|
|
|
@code {
|
|
[CascadingParameter]
|
|
private Task<AuthenticationState> authenticationStateTask { get; set; }
|
|
|
|
private async Task Logout()
|
|
{
|
|
await AuthenticationClientService.LogoutAsync();
|
|
Navigation.NavigateTo("/");
|
|
}
|
|
|
|
private void LoginIN()
|
|
{
|
|
Navigation.NavigateToLogin("/login");
|
|
}
|
|
|
|
} |