This commit is contained in:
parent
08d30c7fc4
commit
44cec4cccd
@ -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);
|
||||
}
|
||||
|
||||
// 로그인 페이지가 아닐 때만 날씨 정보를 가져오도록
|
||||
if (route.name !== 'login' && route.name !== undefined) {
|
||||
// 날씨 정보 갱신
|
||||
await weatherStore.getWeatherInfo();
|
||||
weather.value = weatherStore.weather; // 오늘 날씨
|
||||
dailyWeatherList.value = weatherStore.dailyWeatherList; // 주간 날씨
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
@ -42,7 +42,6 @@ export const useWeatherStore = defineStore('weather', () => {
|
||||
}
|
||||
|
||||
dailyWeatherList.value = resData.dailyWeatherList;
|
||||
console.log('dailyWeatherList.value: ', dailyWeatherList.value);
|
||||
|
||||
const now = new Date();
|
||||
const closest = data.list.reduce((prev, curr) => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user