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); };