Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export class Client {
- private static instance: Client;
- public axios: AxiosInstance;
- public static getInstance(): Client {
- if (!Client.instance) {
- Client.instance = new Client();
- }
- return Client.instance;
- }
- private constructor() {
- this.axios = axios.create({
- proxy: proxyConfig,
- });
- this.axios.interceptors.request.use(({ headers, ...param }: AxiosRequestConfig) => ({
- ...param,
- baseURL: '/api',
- headers: {
- ...headers,
- 'x-channel': 'WEB',
- },
- }));
- this.init();
- }
- init = async () => {
- if (!getValue(BANK_DEVICE_TOKEN_KEY)) {
- const token = getBankDeviceTokenHeaders();
- console.log(token);
- debugger;
- return token;
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment