Merge pull request #8073 from dataease/pr@dev-v2@fix_embedded_axios

fix: 嵌入式请求前缀
This commit is contained in:
fit2cloud-chenyw 2024-02-20 12:04:05 +08:00 committed by GitHub
commit 072c582445
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -33,10 +33,11 @@ import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()
const embeddedStore = useEmbedded()
const basePath = import.meta.env.VITE_API_BASEPATH
export const PATH_URL = embeddedStore.baseUrl
? embeddedStore?.baseUrl + 'de2api/'
: import.meta.env.VITE_API_BASEPATH
const embeddedBasePath =
basePath.startsWith('./') && basePath.length > 2 ? basePath.substring(2) : basePath
export const PATH_URL = embeddedStore.baseUrl ? embeddedStore?.baseUrl + embeddedBasePath : basePath
export interface AxiosInstanceWithLoading extends AxiosInstance {
<T = any, R = AxiosResponse<T>, D = any>(