2024-09-14 08:09:20 +08:00

16 lines
480 B
TypeScript

import { generateProxyPattern } from '@/../build/proxy'
import { serviceConfig } from '@/../service.config'
import { createAlovaInstance } from './alova'
const isHttpProxy = import.meta.env.DEV && import.meta.env.VITE_HTTP_PROXY === 'Y'
const { url } = generateProxyPattern(serviceConfig[import.meta.env.MODE])
export const request = createAlovaInstance({
baseURL: isHttpProxy ? url.proxy : url.value,
})
export const blankInstance = createAlovaInstance({
baseURL: '',
})