17 lines
375 B
TypeScript
17 lines
375 B
TypeScript
import Network from "../utils/Network";
|
|
|
|
let serviceAxios: any | null = null;
|
|
|
|
function getServiceAxios(): any {
|
|
if (serviceAxios === null) {
|
|
serviceAxios = Network.axios;
|
|
}
|
|
return serviceAxios;
|
|
}
|
|
|
|
export const axios = new Proxy({} as any, {
|
|
get(_target: any, prop: string | symbol, receiver: any): any {
|
|
return Reflect.get(getServiceAxios(), prop, receiver);
|
|
}
|
|
});
|