This commit is contained in:
parent
08d30c7fc4
commit
44cec4cccd
@ -211,7 +211,7 @@
|
|||||||
import { useAuthStore } from '@s/useAuthStore';
|
import { useAuthStore } from '@s/useAuthStore';
|
||||||
import { useUserInfoStore } from '@/stores/useUserInfoStore';
|
import { useUserInfoStore } from '@/stores/useUserInfoStore';
|
||||||
import { useProjectStore } from '@/stores/useProjectStore';
|
import { useProjectStore } from '@/stores/useProjectStore';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter, useRoute } from 'vue-router';
|
||||||
import { useThemeStore } from '@s/darkmode';
|
import { useThemeStore } from '@s/darkmode';
|
||||||
import { useWeatherStore } from '@/stores/useWeatherStore';
|
import { useWeatherStore } from '@/stores/useWeatherStore';
|
||||||
import { computed, onMounted, ref, watch } from 'vue';
|
import { computed, onMounted, ref, watch } from 'vue';
|
||||||
@ -223,6 +223,7 @@
|
|||||||
const userStore = useUserInfoStore();
|
const userStore = useUserInfoStore();
|
||||||
const projectStore = useProjectStore();
|
const projectStore = useProjectStore();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
const route = useRoute();
|
||||||
const weatherStore = useWeatherStore();
|
const weatherStore = useWeatherStore();
|
||||||
|
|
||||||
const user = ref(null);
|
const user = ref(null);
|
||||||
@ -316,10 +317,13 @@
|
|||||||
projectStore.setSelectedProject(firstProject);
|
projectStore.setSelectedProject(firstProject);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 날씨 정보 갱신
|
// 로그인 페이지가 아닐 때만 날씨 정보를 가져오도록
|
||||||
await weatherStore.getWeatherInfo();
|
if (route.name !== 'login' && route.name !== undefined) {
|
||||||
weather.value = weatherStore.weather; // 오늘 날씨
|
// 날씨 정보 갱신
|
||||||
dailyWeatherList.value = weatherStore.dailyWeatherList; // 주간 날씨
|
await weatherStore.getWeatherInfo();
|
||||||
|
weather.value = weatherStore.weather; // 오늘 날씨
|
||||||
|
dailyWeatherList.value = weatherStore.dailyWeatherList; // 주간 날씨
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -42,7 +42,6 @@ export const useWeatherStore = defineStore('weather', () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dailyWeatherList.value = resData.dailyWeatherList;
|
dailyWeatherList.value = resData.dailyWeatherList;
|
||||||
console.log('dailyWeatherList.value: ', dailyWeatherList.value);
|
|
||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const closest = data.list.reduce((prev, curr) => {
|
const closest = data.list.reduce((prev, curr) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user