diff --git a/src/App.vue b/src/App.vue index 1fa8be6..c3d7bc7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -45,6 +45,8 @@ onMounted(() => { window.addEventListener('auth:unauthorized', onUnauthorized) window.addEventListener('premium:required', onPremiumRequired) ui.loadSignupEnabled() // 회원가입 허용 여부 선로딩(랜딩/로그인 가입 버튼에 반영) + // 로그인 상태면 전체 프로필(아바타·포인트) 최신화 — 재로그인 없이 헤더 아바타 반영 + if (auth.isAuthenticated) auth.refreshProfile() }) onUnmounted(() => { window.removeEventListener('auth:unauthorized', onUnauthorized) diff --git a/src/api/authApi.js b/src/api/authApi.js index 976cd30..706ec66 100644 --- a/src/api/authApi.js +++ b/src/api/authApi.js @@ -43,4 +43,8 @@ export const authApi = { points() { return http.get('/auth/points') }, + // 현재 사용자 전체 프로필(아바타·포인트 포함) — 재로그인 없이 최신값 동기화 + profile() { + return http.get('/auth/profile') + }, } diff --git a/src/components/layout/AppHeader.vue b/src/components/layout/AppHeader.vue index 3bde8e7..eb29fa0 100644 --- a/src/components/layout/AppHeader.vue +++ b/src/components/layout/AppHeader.vue @@ -1,10 +1,11 @@