API 参考
    正在准备搜索索引...

    接口 VipAxiosInstance

    VipAxios实例类型

    • 继承自AxiosInstance,添加了自定义方法
    • 提供了清除拦截器的方法
    • 提供了获取默认配置的方法
    interface VipAxiosInstance {
        clearInterceptor: (type: InterceptorType) => void;
        defaults: Omit<AxiosDefaults<any>, "headers"> & {
            headers: HeadersDefaults & { [key: string]: AxiosHeaderValue };
        };
        getConfig: () => undefined | CreateAxiosDefaults<any>;
        interceptors: {
            request: AxiosInterceptorManager<InternalAxiosRequestConfig<any>>;
            response: AxiosInterceptorManager<AxiosResponse<any, any>>;
        };
        create(config?: CreateAxiosDefaults<any>): AxiosInstance;
        delete<T = any, R = AxiosResponse<T, any>, D = any>(
            url: string,
            config?: AxiosRequestConfig<D>,
        ): Promise<R>;
        get<T = any, R = AxiosResponse<T, any>, D = any>(
            url: string,
            config?: AxiosRequestConfig<D>,
        ): Promise<R>;
        getUri(config?: AxiosRequestConfig<any>): string;
        head<T = any, R = AxiosResponse<T, any>, D = any>(
            url: string,
            config?: AxiosRequestConfig<D>,
        ): Promise<R>;
        options<T = any, R = AxiosResponse<T, any>, D = any>(
            url: string,
            config?: AxiosRequestConfig<D>,
        ): Promise<R>;
        patch<T = any, R = AxiosResponse<T, any>, D = any>(
            url: string,
            data?: D,
            config?: AxiosRequestConfig<D>,
        ): Promise<R>;
        patchForm<T = any, R = AxiosResponse<T, any>, D = any>(
            url: string,
            data?: D,
            config?: AxiosRequestConfig<D>,
        ): Promise<R>;
        post<T = any, R = AxiosResponse<T, any>, D = any>(
            url: string,
            data?: D,
            config?: AxiosRequestConfig<D>,
        ): Promise<R>;
        postForm<T = any, R = AxiosResponse<T, any>, D = any>(
            url: string,
            data?: D,
            config?: AxiosRequestConfig<D>,
        ): Promise<R>;
        put<T = any, R = AxiosResponse<T, any>, D = any>(
            url: string,
            data?: D,
            config?: AxiosRequestConfig<D>,
        ): Promise<R>;
        putForm<T = any, R = AxiosResponse<T, any>, D = any>(
            url: string,
            data?: D,
            config?: AxiosRequestConfig<D>,
        ): Promise<R>;
        request<T = any, R = AxiosResponse<T, any>, D = any>(
            config: AxiosRequestConfig<D>,
        ): Promise<R>;
        <T = any, R = AxiosResponse<T, any>, D = any>(
            config: AxiosRequestConfig<D>,
        ): Promise<R>;
        <T = any, R = AxiosResponse<T, any>, D = any>(
            url: string,
            config?: AxiosRequestConfig<D>,
        ): Promise<R>;
    }

    层级

    • AxiosInstance
      • VipAxiosInstance
    • 类型参数

      • T = any
      • R = AxiosResponse<T, any>
      • D = any

      参数

      • config: AxiosRequestConfig<D>

      返回 Promise<R>

    • 类型参数

      • T = any
      • R = AxiosResponse<T, any>
      • D = any

      参数

      • url: string
      • 可选config: AxiosRequestConfig<D>

      返回 Promise<R>

    索引

    属性

    clearInterceptor: (type: InterceptorType) => void
    defaults: Omit<AxiosDefaults<any>, "headers"> & {
        headers: HeadersDefaults & { [key: string]: AxiosHeaderValue };
    }
    getConfig: () => undefined | CreateAxiosDefaults<any>
    interceptors: {
        request: AxiosInterceptorManager<InternalAxiosRequestConfig<any>>;
        response: AxiosInterceptorManager<AxiosResponse<any, any>>;
    }

    方法

    • 参数

      • 可选config: CreateAxiosDefaults<any>

      返回 AxiosInstance

    • 类型参数

      • T = any
      • R = AxiosResponse<T, any>
      • D = any

      参数

      • url: string
      • 可选config: AxiosRequestConfig<D>

      返回 Promise<R>

    • 类型参数

      • T = any
      • R = AxiosResponse<T, any>
      • D = any

      参数

      • url: string
      • 可选config: AxiosRequestConfig<D>

      返回 Promise<R>

    • 参数

      • 可选config: AxiosRequestConfig<any>

      返回 string

    • 类型参数

      • T = any
      • R = AxiosResponse<T, any>
      • D = any

      参数

      • url: string
      • 可选config: AxiosRequestConfig<D>

      返回 Promise<R>

    • 类型参数

      • T = any
      • R = AxiosResponse<T, any>
      • D = any

      参数

      • url: string
      • 可选config: AxiosRequestConfig<D>

      返回 Promise<R>

    • 类型参数

      • T = any
      • R = AxiosResponse<T, any>
      • D = any

      参数

      • url: string
      • 可选data: D
      • 可选config: AxiosRequestConfig<D>

      返回 Promise<R>

    • 类型参数

      • T = any
      • R = AxiosResponse<T, any>
      • D = any

      参数

      • url: string
      • 可选data: D
      • 可选config: AxiosRequestConfig<D>

      返回 Promise<R>

    post

    • post<T = any, R = AxiosResponse<T, any>, D = any>(
          url: string,
          data?: D,
          config?: AxiosRequestConfig<D>,
      ): Promise<R>

      类型参数

      • T = any
      • R = AxiosResponse<T, any>
      • D = any

      参数

      • url: string
      • 可选data: D
      • 可选config: AxiosRequestConfig<D>

      返回 Promise<R>

    • 类型参数

      • T = any
      • R = AxiosResponse<T, any>
      • D = any

      参数

      • url: string
      • 可选data: D
      • 可选config: AxiosRequestConfig<D>

      返回 Promise<R>

    • 类型参数

      • T = any
      • R = AxiosResponse<T, any>
      • D = any

      参数

      • url: string
      • 可选data: D
      • 可选config: AxiosRequestConfig<D>

      返回 Promise<R>

    • 类型参数

      • T = any
      • R = AxiosResponse<T, any>
      • D = any

      参数

      • url: string
      • 可选data: D
      • 可选config: AxiosRequestConfig<D>

      返回 Promise<R>

    • 类型参数

      • T = any
      • R = AxiosResponse<T, any>
      • D = any

      参数

      • config: AxiosRequestConfig<D>

      返回 Promise<R>