diff --git a/nuxt.config.ts b/nuxt.config.ts index 0d958cd..74c113f 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -27,6 +27,7 @@ export default defineNuxtConfig({ public: { // apiBase: process.env.mode == 'DEVELOPMENT' ? "http://localhost:8000" : "https://mns.kustarshina.ru/kp", apiBase: process.env.mode == 'DEVELOPMENT' ? "http://mns.dev.kustarshina.ru/kp" : "https://mns.kustarshina.ru/kp", + // apiBase: 'http://localhost:8000', imgBase: 'https://mns.kustarshina.ru', baseUrl: '', yandexMetrika: { diff --git a/pages/index.vue b/pages/index.vue index 3dab788..f1683a2 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -24,7 +24,7 @@ const pagesData = menuData.value ? menuData.value.pages : [] const { data: reviewsData } = await apiFetch(`review/`) -const { data: calculators } = await apiFetch('calculator') +const { data: calculators } = await apiFetch('calculator/') const openTab = ref() if (calculators.value?.length) openTab.value = calculators.value[0].id diff --git a/utils/apiFetch.ts b/utils/apiFetch.ts index e42ca76..89927dc 100644 --- a/utils/apiFetch.ts +++ b/utils/apiFetch.ts @@ -3,6 +3,7 @@ export async function apiFetch(path: string) { const apiBase = config.public.apiBase const headers = new Headers() headers.set('Referer', config.public.baseUrl) + return useFetch(`${apiBase}/${path}`, { baseURL: config.public.baseUrl, headers,