dev #90
|
@ -27,6 +27,7 @@ export default defineNuxtConfig({
|
||||||
public: {
|
public: {
|
||||||
// apiBase: process.env.mode == 'DEVELOPMENT' ? "http://localhost:8000" : "https://mns.kustarshina.ru/kp",
|
// 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: process.env.mode == 'DEVELOPMENT' ? "http://mns.dev.kustarshina.ru/kp" : "https://mns.kustarshina.ru/kp",
|
||||||
|
// apiBase: 'http://localhost:8000',
|
||||||
imgBase: 'https://mns.kustarshina.ru',
|
imgBase: 'https://mns.kustarshina.ru',
|
||||||
baseUrl: '',
|
baseUrl: '',
|
||||||
yandexMetrika: {
|
yandexMetrika: {
|
||||||
|
|
|
@ -24,7 +24,7 @@ const pagesData = menuData.value ? menuData.value.pages : []
|
||||||
|
|
||||||
const { data: reviewsData } = await apiFetch<ApiReviewsType[]>(`review/`)
|
const { data: reviewsData } = await apiFetch<ApiReviewsType[]>(`review/`)
|
||||||
|
|
||||||
const { data: calculators } = await apiFetch<ApiCalcType[]>('calculator')
|
const { data: calculators } = await apiFetch<ApiCalcType[]>('calculator/')
|
||||||
const openTab = ref<number>()
|
const openTab = ref<number>()
|
||||||
if (calculators.value?.length) openTab.value = calculators.value[0].id
|
if (calculators.value?.length) openTab.value = calculators.value[0].id
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ export async function apiFetch<T>(path: string) {
|
||||||
const apiBase = config.public.apiBase
|
const apiBase = config.public.apiBase
|
||||||
const headers = new Headers()
|
const headers = new Headers()
|
||||||
headers.set('Referer', config.public.baseUrl)
|
headers.set('Referer', config.public.baseUrl)
|
||||||
|
|
||||||
return useFetch<T>(`${apiBase}/${path}`, {
|
return useFetch<T>(`${apiBase}/${path}`, {
|
||||||
baseURL: config.public.baseUrl,
|
baseURL: config.public.baseUrl,
|
||||||
headers,
|
headers,
|
||||||
|
|
Loading…
Reference in New Issue