Доработан поиск и добавление треков

This commit is contained in:
FrigaT
2026-04-14 22:26:58 +03:00
parent 0381ef74ab
commit 6ae49faf15
16 changed files with 92 additions and 99 deletions

View File

@@ -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)
{