로그인 페이지에 날씨정보 안가져오게
All checks were successful
LocalNet_front/pipeline/head This commit looks good

This commit is contained in:
nevermoregb 2025-04-05 00:25:25 +09:00
parent 08d30c7fc4
commit 44cec4cccd
2 changed files with 9 additions and 6 deletions

View File

@ -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);
} }
//
if (route.name !== 'login' && route.name !== undefined) {
// //
await weatherStore.getWeatherInfo(); await weatherStore.getWeatherInfo();
weather.value = weatherStore.weather; // weather.value = weatherStore.weather; //
dailyWeatherList.value = weatherStore.dailyWeatherList; // dailyWeatherList.value = weatherStore.dailyWeatherList; //
}
}); });
</script> </script>
<style scoped> <style scoped>

View File

@ -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) => {