df4d85d789
TaxBaik CI/CD / build-and-deploy (push) Successful in 34s
문제: ❌ 로그인 페이지에서 MudBlazor CSS가 적용되지 않음 ❌ 스타일이 없는 상태로 렌더링됨 원인: • BlankLayout에만 MudThemeProvider가 있음 • Login.razor는 직접 MudThemeProvider를 가지지 않음 • Blazor Interactive Server에서 컴포넌트 초기화 전 렌더링됨 수정: ✅ Login.razor에 MudThemeProvider 추가 ✅ MudDialogProvider, MudSnackbarProvider도 추가 ✅ 버전 파일 자동 생성 (git commit hash + timestamp) 배포: Release 빌드 → wwwroot/version.txt 생성 → 서버 배포 → systemctl restart 결과: ✅ 로그인 페이지 CSS 정상 렌더링 ✅ 버전 정보 최신화 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
97 lines
3.0 KiB
Plaintext
97 lines
3.0 KiB
Plaintext
@page "/admin/login"
|
|
@using System.ComponentModel.DataAnnotations
|
|
@layout TaxBaik.Web.Components.Admin.Layout.BlankLayout
|
|
@attribute [AllowAnonymous]
|
|
@inject IApiClient ApiClient
|
|
@inject NavigationManager NavigationManager
|
|
@inject CustomAuthenticationStateProvider AuthStateProvider
|
|
|
|
<PageTitle>로그인</PageTitle>
|
|
|
|
<MudThemeProvider />
|
|
<MudDialogProvider />
|
|
<MudSnackbarProvider />
|
|
|
|
<MudContainer MaxWidth="MaxWidth.Small" Class="d-flex align-center justify-center" Style="min-height: 100vh;">
|
|
<MudPaper Class="pa-8" Elevation="3" Style="width: 100%; max-width: 400px;">
|
|
<MudText Typo="Typo.h4" Class="mb-6 text-center">관리자 로그인</MudText>
|
|
|
|
<MudForm @ref="form" @bind-IsValid="@isFormValid">
|
|
<MudTextField @bind-Value="model.Username" Label="사용자명"
|
|
Variant="Variant.Outlined" Required="true" Class="mb-4" />
|
|
|
|
<MudTextField @bind-Value="model.Password" Label="비밀번호" InputType="InputType.Password"
|
|
Variant="Variant.Outlined" Required="true" Class="mb-4" />
|
|
|
|
@if (!string.IsNullOrEmpty(errorMessage))
|
|
{
|
|
<MudAlert Severity="Severity.Error" Class="mb-4">@errorMessage</MudAlert>
|
|
}
|
|
|
|
<MudButton Variant="Variant.Filled" Color="Color.Primary" FullWidth="true"
|
|
Size="Size.Large" OnClick="HandleLogin" Disabled="isLoading">
|
|
@if (isLoading)
|
|
{
|
|
<MudProgressCircular Size="Size.Small" Indeterminate="true" Class="mr-2" />
|
|
<span>로그인 중...</span>
|
|
}
|
|
else
|
|
{
|
|
<span>로그인</span>
|
|
}
|
|
</MudButton>
|
|
</MudForm>
|
|
</MudPaper>
|
|
</MudContainer>
|
|
|
|
@code {
|
|
private MudForm form;
|
|
private bool isFormValid = false;
|
|
private bool isLoading = false;
|
|
private string errorMessage = "";
|
|
|
|
private LoginModel model = new();
|
|
|
|
private async Task HandleLogin()
|
|
{
|
|
if (isLoading)
|
|
return;
|
|
|
|
isLoading = true;
|
|
errorMessage = "";
|
|
|
|
try
|
|
{
|
|
var request = new { model.Username, model.Password };
|
|
var response = await ApiClient.PostAsync<LoginResponse>("auth/login", request);
|
|
|
|
if (response?.Token == null)
|
|
{
|
|
errorMessage = "사용자명 또는 비밀번호가 올바르지 않습니다.";
|
|
isLoading = false;
|
|
return;
|
|
}
|
|
|
|
await AuthStateProvider.LoginAsync(response.Token);
|
|
NavigationManager.NavigateTo("/taxbaik/admin/dashboard", forceLoad: false);
|
|
}
|
|
catch
|
|
{
|
|
errorMessage = "로그인 중 오류가 발생했습니다.";
|
|
isLoading = false;
|
|
}
|
|
}
|
|
|
|
private class LoginResponse
|
|
{
|
|
public string Token { get; set; } = "";
|
|
public int ExpiresIn { get; set; }
|
|
}
|
|
|
|
private class LoginModel
|
|
{
|
|
public string Username { get; set; } = "";
|
|
public string Password { get; set; } = "";
|
|
}
|
|
}
|