Доработан поиск и добавление треков
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
|
||||
<!-- Локальная форма входа -->
|
||||
<MudTextField @bind-Value="_loginModel.Username" Label="Имя пользователя" Variant="Variant.Outlined" FullWidth="true" Class="mb-3" />
|
||||
<MudTextField @bind-Value="_loginModel.Password" Label="Пароль" Variant="Variant.Outlined" FullWidth="true" InputType="InputType.Password" @onkeypress="@(async (e) => { if (e.Key == "Enter") await LocalLogin(); })" />
|
||||
<MudTextField @bind-Value="_loginModel.Password" Label="Пароль" Variant="Variant.Outlined" FullWidth="true" InputType="InputType.Password" OnKeyUp="@(async (e) => { if (e.Key == "Enter") await LocalLogin(); })" />
|
||||
|
||||
<MudButton Variant="Variant.Outlined" Color="Color.Secondary" OnClick="LocalLogin" FullWidth="true" Class="mt-4">
|
||||
Войти (локально)
|
||||
@@ -48,6 +48,12 @@
|
||||
|
||||
private async Task LocalLogin()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(_loginModel.Username) || string.IsNullOrWhiteSpace(_loginModel.Password))
|
||||
{
|
||||
Snackbar.Add("Пожалуйста, заполните все поля", Severity.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
var response = await Http.PostAsJsonAsync("/api/account/login", _loginModel);
|
||||
if (response.IsSuccessStatusCode)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user