UNPKG

we-req

Version:

weReq是基于微信小程序的 wx.request的高级封装,提供全局和外部拦截器的管理,支持自动登录等功能,旨在简化微信小程序网络请求的处理流程,提升开发者的使用体验。

21 lines (20 loc) 627 B
import { RequestConfig } from '../type'; declare class Request { private config; private autoLoginConfig?; private interceptorsManagers; private loading; private retryAttempts; private isRefreshing; private failedQueue; constructor(config: RequestConfig); private login; private refreshTokenFn; private handleResponse; handleTokenRefresh(): Promise<unknown>; request(uniConfig: any): Promise<any>; get(uniConfig: RequestConfig): Promise<any>; post(uniConfig: RequestConfig): Promise<any>; delete(uniConfig: RequestConfig): Promise<any>; } export default Request;