|
|
@ -6,14 +6,17 @@ import { addAxiosInterceptors } from './interceptors' |
|
|
|
import { BASE_FALLBACK_URL, createEventHook, extractSdkResponseErrorMsg, ref, unref, useCounter, useNuxtApp } from '#imports' |
|
|
|
import { BASE_FALLBACK_URL, createEventHook, extractSdkResponseErrorMsg, ref, unref, useCounter, useNuxtApp } from '#imports' |
|
|
|
|
|
|
|
|
|
|
|
export function createApiInstance<SecurityDataType = any>({ |
|
|
|
export function createApiInstance<SecurityDataType = any>({ |
|
|
|
baseURL = BASE_FALLBACK_URL, |
|
|
|
baseURL: _baseUrl = BASE_FALLBACK_URL, |
|
|
|
}: CreateApiOptions = {}): Api<SecurityDataType> { |
|
|
|
}: CreateApiOptions = {}): Api<SecurityDataType> { |
|
|
|
const config = useRuntimeConfig() |
|
|
|
const config = useRuntimeConfig() |
|
|
|
|
|
|
|
const baseURL = config.public.ncBackendUrl || _baseUrl |
|
|
|
return addAxiosInterceptors( |
|
|
|
return addAxiosInterceptors( |
|
|
|
new Api<SecurityDataType>({ |
|
|
|
new Api<SecurityDataType>( |
|
|
|
baseURL: config.public.ncBackendUrl || baseURL, |
|
|
|
{ |
|
|
|
}), |
|
|
|
baseURL, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
baseUrl, |
|
|
|
|
|
|
|
), |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|