diff --git a/src/layouts/TheTop.vue b/src/layouts/TheTop.vue index 8cb7c8b..d00e17c 100644 --- a/src/layouts/TheTop.vue +++ b/src/layouts/TheTop.vue @@ -211,7 +211,7 @@ import { useAuthStore } from '@s/useAuthStore'; import { useUserInfoStore } from '@/stores/useUserInfoStore'; import { useProjectStore } from '@/stores/useProjectStore'; - import { useRouter } from 'vue-router'; + import { useRouter, useRoute } from 'vue-router'; import { useThemeStore } from '@s/darkmode'; import { useWeatherStore } from '@/stores/useWeatherStore'; import { computed, onMounted, ref, watch } from 'vue'; @@ -223,6 +223,7 @@ const userStore = useUserInfoStore(); const projectStore = useProjectStore(); const router = useRouter(); + const route = useRoute(); const weatherStore = useWeatherStore(); const user = ref(null); @@ -316,10 +317,13 @@ projectStore.setSelectedProject(firstProject); } - // 날씨 정보 갱신 - await weatherStore.getWeatherInfo(); - weather.value = weatherStore.weather; // 오늘 날씨 - dailyWeatherList.value = weatherStore.dailyWeatherList; // 주간 날씨 + // 로그인 페이지가 아닐 때만 날씨 정보를 가져오도록 + if (route.name !== 'login' && route.name !== undefined) { + // 날씨 정보 갱신 + await weatherStore.getWeatherInfo(); + weather.value = weatherStore.weather; // 오늘 날씨 + dailyWeatherList.value = weatherStore.dailyWeatherList; // 주간 날씨 + } });