From b26585b225fb1e124a15222da952a57ec7a364c7 Mon Sep 17 00:00:00 2001 From: ckx6954 Date: Wed, 18 Dec 2024 20:25:54 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A3=BC=EC=84=9D=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/calendar/SampleCalendar.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/calendar/SampleCalendar.vue b/src/components/calendar/SampleCalendar.vue index 79922d7..8ec4068 100644 --- a/src/components/calendar/SampleCalendar.vue +++ b/src/components/calendar/SampleCalendar.vue @@ -19,6 +19,7 @@ import { isEmpty } from '@/common/utils'; const key1 = 'vrkIY7jUy82WRHIozbBtz4n2L89jAqNDY%2B4DmNpmasTex%2FNDySN7FDYwBqPj1p%2BxXLg13BzYfgHPt6eipWhH8Q%3D%3D'; const key2 = 'vrkIY7jUy82WRHIozbBtz4n2L89jAqNDY+4DmNpmasTex/NDySN7FDYwBqPj1p+xXLg13BzYfgHPt6eipWhH8Q=='; const dayjs = inject('dayjs'); +const fullCalendarRef = ref(null); const fetchData = () => { const date = fullCalendarRef.value?.getApi().currentData.viewTitle; @@ -53,13 +54,17 @@ const fetchData = () => { callApi(yearArr, monthArr); }; +//이 통신은 key 노출 땜 시 backserver로 옮겨야할듯 +//실제 개발 할 때 back으로 옮김 const callApi = (yearArr, monthArr) => { + const callUrl = 'http://apis.data.go.kr/B090041/openapi/service/SpcdeInfoService/getRestDeInfo'; + for (let i = 0; i < yearArr.length; i++) { - axios.get('http://apis.data.go.kr/B090041/openapi/service/SpcdeInfoService/getRestDeInfo', { + axios.get(callUrl , { params: { - serviceKey: key2, solYear: String(yearArr[i]), solMonth: String(monthArr[i]), + serviceKey: key1, }, }) .then(data => { @@ -92,8 +97,6 @@ const dateFormat = (locdate) => { } } -const fullCalendarRef = ref(null); - const handleDateClick = arg => { console.log(arg.dateStr); };