로그인창에서 새로고침시 날씨 401에러나는거 수정
This commit is contained in:
parent
29ee90a84e
commit
2072a41ca9
@ -368,11 +368,15 @@
|
|||||||
const weatherKorean = computed(() => weather.value.description || '날씨 정보 없음');
|
const weatherKorean = computed(() => weather.value.description || '날씨 정보 없음');
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
||||||
|
if (!userStore.user) return;
|
||||||
|
|
||||||
navigator.geolocation.getCurrentPosition(async (position) => {
|
navigator.geolocation.getCurrentPosition(async (position) => {
|
||||||
const lat = position.coords.latitude;
|
const lat = position.coords.latitude;
|
||||||
const lon = position.coords.longitude;
|
const lon = position.coords.longitude;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
await userStore.userInfo();
|
||||||
const res = await axios.get(`/weather`, {
|
const res = await axios.get(`/weather`, {
|
||||||
params: { lat, lon },
|
params: { lat, lon },
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user