API 클라이언트 경로 최적화: 모든 절대 경로 → 상대 경로 전환
## 변경사항 - ApiClient (2개): BuildApiUri에서 /taxbaik 절대 경로 제거 - TokenRefreshHandler: 토큰 갱신 엔드포인트 상대 경로로 변경 - AdminNavigationModel: 모든 네비게이션 링크 상대 경로로 변경 - E2E 테스트: /taxbaik/admin/dashboard → /admin/dashboard 경로 업데이트 - E2E 필터: WASM 오류 필터 경로 업데이트 ## 현황 ✅ 빌드: 0 오류, 2 경고 ✅ 공개 페이지: 5/5 E2E 테스트 통과 ❌ 관리자 페이지: WASM 부팅 오류 (원인 조사 중) ✅ 로그인 API: SSH 터널 연결 시 정상 작동 확인 ## 다음 단계 - WASM 부팅 오류 원인 파악 (브라우저 콘솔 확인 필요) - 혹은 다른 경로 하드코딩 찾기 - 프로덕션 배포 검증 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -106,6 +106,6 @@ public class ApiClient : IApiClient
|
||||
{
|
||||
var relative = $"api/{endpoint.TrimStart('/')}";
|
||||
var appRoot = new Uri(_navigationManager.BaseUri);
|
||||
return new Uri(appRoot, $"/taxbaik/{relative}");
|
||||
return new Uri(appRoot, $"/{relative}"); // 상대 경로 사용 (Nginx가 /taxbaik 프리픽스 처리)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class TokenRefreshHandler : DelegatingHandler
|
||||
var scheme = originalRequest.RequestUri?.Scheme ?? "http";
|
||||
|
||||
using var httpClient = new HttpClient();
|
||||
var refreshUri = new Uri($"{scheme}://{authority}/taxbaik/api/auth/refresh");
|
||||
var refreshUri = new Uri($"{scheme}://{authority}/api/auth/refresh"); // 상대 경로 사용 (Nginx가 /taxbaik 프리픽스 처리)
|
||||
var json = JsonSerializer.Serialize(new { refreshToken });
|
||||
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");
|
||||
|
||||
|
||||
@@ -19,28 +19,28 @@ public static class AdminNavigationCatalog
|
||||
public static IReadOnlyList<AdminNavigationSection> Sections { get; } =
|
||||
[
|
||||
new("개요", [
|
||||
new("대시보드", "/taxbaik/admin/dashboard", Icons.Material.Filled.Dashboard, IsExact: true),
|
||||
new("대시보드", "/admin/dashboard", Icons.Material.Filled.Dashboard, IsExact: true),
|
||||
]),
|
||||
new("CRM & 세무관리", [
|
||||
new("세무 프로필", "/taxbaik/admin/tax-profiles", Icons.Material.Filled.Badge, AllowedRoles: ["Admin", "Manager"]),
|
||||
new("신고 일정", "/taxbaik/admin/tax-filing-schedules", Icons.Material.Filled.EventNote, AllowedRoles: ["Admin", "Manager"]),
|
||||
new("계약 관리", "/taxbaik/admin/contracts", Icons.Material.Filled.Description, AllowedRoles: ["Admin", "Manager"]),
|
||||
new("상담 활동", "/taxbaik/admin/consulting-activities", Icons.Material.Filled.SupportAgent, AllowedRoles: ["Admin", "Manager"]),
|
||||
new("수익 추적", "/taxbaik/admin/revenue-trackings", Icons.Material.Filled.Payments, AllowedRoles: ["Admin"]),
|
||||
new("세무 프로필", "/admin/tax-profiles", Icons.Material.Filled.Badge, AllowedRoles: ["Admin", "Manager"]),
|
||||
new("신고 일정", "/admin/tax-filing-schedules", Icons.Material.Filled.EventNote, AllowedRoles: ["Admin", "Manager"]),
|
||||
new("계약 관리", "/admin/contracts", Icons.Material.Filled.Description, AllowedRoles: ["Admin", "Manager"]),
|
||||
new("상담 활동", "/admin/consulting-activities", Icons.Material.Filled.SupportAgent, AllowedRoles: ["Admin", "Manager"]),
|
||||
new("수익 추적", "/admin/revenue-trackings", Icons.Material.Filled.Payments, AllowedRoles: ["Admin"]),
|
||||
]),
|
||||
new("고객 관리", [
|
||||
new("고객 카드", "/taxbaik/admin/clients", Icons.Material.Filled.Groups, AllowedRoles: ["Admin", "Manager", "Staff"]),
|
||||
new("세무신고", "/taxbaik/admin/tax-filings", Icons.Material.Filled.Assignment, AllowedRoles: ["Admin", "Manager", "Staff"]),
|
||||
new("고객 카드", "/admin/clients", Icons.Material.Filled.Groups, AllowedRoles: ["Admin", "Manager", "Staff"]),
|
||||
new("세무신고", "/admin/tax-filings", Icons.Material.Filled.Assignment, AllowedRoles: ["Admin", "Manager", "Staff"]),
|
||||
]),
|
||||
new("홈페이지", [
|
||||
new("공지사항", "/taxbaik/admin/announcements", Icons.Material.Filled.Campaign, AllowedRoles: ["Admin", "ContentManager"]),
|
||||
new("FAQ 관리", "/taxbaik/admin/faqs", Icons.Material.Filled.HelpOutline, AllowedRoles: ["Admin", "ContentManager"]),
|
||||
new("블로그 관리", "/taxbaik/admin/blog", Icons.Material.Filled.Article, AllowedRoles: ["Admin", "ContentManager"]),
|
||||
new("시즌 시뮬레이터", "/taxbaik/admin/season-simulator", Icons.Material.Filled.CalendarMonth, AllowedRoles: ["Admin", "ContentManager"]),
|
||||
new("문의 관리", "/taxbaik/admin/inquiries", Icons.Material.Filled.Inbox, AllowedRoles: ["Admin", "Manager", "Staff"]),
|
||||
new("클라이언트 로그", "/taxbaik/admin/client-logs", Icons.Material.Filled.BugReport, AllowedRoles: ["Admin"]),
|
||||
new("설정", "/taxbaik/admin/settings", Icons.Material.Filled.Settings, AllowedRoles: ["Admin"]),
|
||||
new("공통관리", "/taxbaik/admin/common-codes", Icons.Material.Filled.Apps, AllowedRoles: ["Admin"]),
|
||||
new("공지사항", "/admin/announcements", Icons.Material.Filled.Campaign, AllowedRoles: ["Admin", "ContentManager"]),
|
||||
new("FAQ 관리", "/admin/faqs", Icons.Material.Filled.HelpOutline, AllowedRoles: ["Admin", "ContentManager"]),
|
||||
new("블로그 관리", "/admin/blog", Icons.Material.Filled.Article, AllowedRoles: ["Admin", "ContentManager"]),
|
||||
new("시즌 시뮬레이터", "/admin/season-simulator", Icons.Material.Filled.CalendarMonth, AllowedRoles: ["Admin", "ContentManager"]),
|
||||
new("문의 관리", "/admin/inquiries", Icons.Material.Filled.Inbox, AllowedRoles: ["Admin", "Manager", "Staff"]),
|
||||
new("클라이언트 로그", "/admin/client-logs", Icons.Material.Filled.BugReport, AllowedRoles: ["Admin"]),
|
||||
new("설정", "/admin/settings", Icons.Material.Filled.Settings, AllowedRoles: ["Admin"]),
|
||||
new("공통관리", "/admin/common-codes", Icons.Material.Filled.Apps, AllowedRoles: ["Admin"]),
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -106,6 +106,6 @@ public class ApiClient : IApiClient
|
||||
{
|
||||
var relative = $"api/{endpoint.TrimStart('/')}";
|
||||
var appRoot = new Uri(_navigationManager.BaseUri);
|
||||
return new Uri(appRoot, $"/taxbaik/{relative}");
|
||||
return new Uri(appRoot, $"/{relative}"); // 상대 경로 사용 (Nginx가 /taxbaik 프리픽스 처리)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,16 +42,24 @@ public class AuthService
|
||||
AdminUser? user;
|
||||
try
|
||||
{
|
||||
_logger.LogDebug("로그인 시도: {Username} - DB 조회 시작", username);
|
||||
user = await _adminUserRepository.GetByUsernameAsync(username);
|
||||
_logger.LogDebug("로그인 시도: {Username} - DB 조회 완료, user={UserExists}", username, user != null ? "found" : "not found");
|
||||
}
|
||||
catch (Exception ex) when (_environment.IsDevelopment())
|
||||
{
|
||||
_logger.LogWarning(ex, "개발 환경에서 관리자 로그인 DB 조회 실패: {Username}", username);
|
||||
_logger.LogError(ex, "❌ [개발 환경] 관리자 로그인 DB 조회 실패: {Username} | Exception Type: {ExType} | Message: {ExMessage}",
|
||||
username, ex.GetType().Name, ex.Message);
|
||||
if (ex.InnerException != null)
|
||||
_logger.LogError(ex.InnerException, " Inner Exception: {InnerExMessage}", ex.InnerException.Message);
|
||||
return AuthResult.DatabaseUnavailable();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "관리자 로그인 중 예상치 못한 오류: {Username}", username);
|
||||
_logger.LogError(ex, "❌ 관리자 로그인 중 예상치 못한 오류: {Username} | Exception Type: {ExType} | Message: {ExMessage}",
|
||||
username, ex.GetType().Name, ex.Message);
|
||||
if (ex.InnerException != null)
|
||||
_logger.LogError(ex.InnerException, " Inner Exception: {InnerExMessage}", ex.InnerException.Message);
|
||||
return AuthResult.DatabaseUnavailable();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user