You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
627 B
26 lines
627 B
/**
|
|
* 该文件可自行根据业务逻辑进行调整
|
|
*/
|
|
import type { RequestClientOptions } from '@vben/request';
|
|
|
|
import { useAppConfig } from '@vben/hooks';
|
|
import { RequestClient } from '@vben/request';
|
|
|
|
export * from './constants';
|
|
export * from './hooks';
|
|
export * from './types';
|
|
|
|
const { apiURL } = useAppConfig(import.meta.env, import.meta.env.PROD);
|
|
|
|
function createRequestClient(baseURL: string, options?: RequestClientOptions) {
|
|
const client = new RequestClient({
|
|
...options,
|
|
baseURL,
|
|
});
|
|
|
|
return client;
|
|
}
|
|
|
|
export const requestClient = createRequestClient(apiURL, {
|
|
responseReturn: 'data',
|
|
});
|
|
|