update_cow_list_ui_2
This commit is contained in:
@@ -2,6 +2,7 @@ import { create } from 'zustand';
|
|||||||
import { persist } from 'zustand/middleware';
|
import { persist } from 'zustand/middleware';
|
||||||
import { authApi } from '@/lib/api/auth.api';
|
import { authApi } from '@/lib/api/auth.api';
|
||||||
import { UserDto, LoginDto, SignupDto } from '@/types/auth.types';
|
import { UserDto, LoginDto, SignupDto } from '@/types/auth.types';
|
||||||
|
import apiClient from '@/lib/api-client';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 인증 Store 상태 - 인증 관련 값 안올때 확인
|
* 인증 Store 상태 - 인증 관련 값 안올때 확인
|
||||||
@@ -59,6 +60,12 @@ export const useAuthStore = create<AuthState>()(
|
|||||||
accessToken: response.accessToken,
|
accessToken: response.accessToken,
|
||||||
isAuthenticated: true,
|
isAuthenticated: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 최근 검사 년도를 localStorage에 저장
|
||||||
|
if (response.defaultAnalysisYear) {
|
||||||
|
localStorage.setItem('defaultAnalysisYear', response.defaultAnalysisYear.toString());
|
||||||
|
console.log('[AuthStore] defaultAnalysisYear saved:', response.defaultAnalysisYear);
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('로그인 실패:', error);
|
console.error('로그인 실패:', error);
|
||||||
throw error;
|
throw error;
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ export interface AuthResponseDto {
|
|||||||
message?: string // 결과 메시지
|
message?: string // 결과 메시지
|
||||||
accessToken: string // JWT 액세스 토큰
|
accessToken: string // JWT 액세스 토큰
|
||||||
user: UserDto // 사용자 정보
|
user: UserDto // 사용자 정보
|
||||||
|
defaultAnalysisYear: number // 최근 검사 년도
|
||||||
}
|
}
|
||||||
|
|
||||||
// ========================================
|
// ========================================
|
||||||
|
|||||||
Reference in New Issue
Block a user