mirror of
https://github.com/chansee97/nova-admin.git
synced 2025-04-05 04:22:49 +08:00
16 lines
480 B
TypeScript
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: '',
|
|
})
|