diff --git a/frontend/src/store/auth-store.ts b/frontend/src/store/auth-store.ts index 380ef58..63d6aa4 100644 --- a/frontend/src/store/auth-store.ts +++ b/frontend/src/store/auth-store.ts @@ -2,6 +2,7 @@ import { create } from 'zustand'; import { persist } from 'zustand/middleware'; import { authApi } from '@/lib/api/auth.api'; import { UserDto, LoginDto, SignupDto } from '@/types/auth.types'; +import apiClient from '@/lib/api-client'; /** * 인증 Store 상태 - 인증 관련 값 안올때 확인 @@ -59,6 +60,12 @@ export const useAuthStore = create()( accessToken: response.accessToken, isAuthenticated: true, }); + + // 최근 검사 년도를 localStorage에 저장 + if (response.defaultAnalysisYear) { + localStorage.setItem('defaultAnalysisYear', response.defaultAnalysisYear.toString()); + console.log('[AuthStore] defaultAnalysisYear saved:', response.defaultAnalysisYear); + } } catch (error) { console.error('로그인 실패:', error); throw error; diff --git a/frontend/src/types/auth.types.ts b/frontend/src/types/auth.types.ts index 9aab6ac..b431cbd 100644 --- a/frontend/src/types/auth.types.ts +++ b/frontend/src/types/auth.types.ts @@ -122,6 +122,7 @@ export interface AuthResponseDto { message?: string // 결과 메시지 accessToken: string // JWT 액세스 토큰 user: UserDto // 사용자 정보 + defaultAnalysisYear: number // 최근 검사 년도 } // ========================================