Skip to content

@vtj


@vtj / utils / IStaticRequest

Interface: IStaticRequest()<R, D>

Defined in: packages/utils/src/request.ts:476

Extends

Type Parameters

R = any

D = any

IStaticRequest(options): Promise<R>

Defined in: packages/utils/src/request.ts:477

Parameters

options

IRequestConfig<D>

Returns

Promise<R>

Properties

axios

axios: AxiosInstance

Defined in: packages/utils/src/request.ts:155

Inherited from

Request.axios


instance

instance: Request

Defined in: packages/utils/src/request.ts:478


isLoading

isLoading: boolean = false

Defined in: packages/utils/src/request.ts:158

Inherited from

Request.isLoading


records

records: Record<string, IRequestRecord> = {}

Defined in: packages/utils/src/request.ts:157

Inherited from

Request.records


settings

settings: IRequestSettings

Defined in: packages/utils/src/request.ts:156

Inherited from

Request.settings

Methods

cancel()

cancel(id?, message?): void

Defined in: packages/utils/src/request.ts:197

Parameters

id?

string

message?

string = '请求已取消'

Returns

void

Inherited from

Request.cancel


send()

send<R, D>(options, isSkipWarn): Promise<R>

Defined in: packages/utils/src/request.ts:359

Type Parameters

R = any

D = any

Parameters

options

IRequestConfig<D> = {}

isSkipWarn

boolean = false

Returns

Promise<R>

Inherited from

Request.send


setConfig()

setConfig(options): void

Defined in: packages/utils/src/request.ts:187

Parameters

options

IRequestOptions = {}

Returns

void

Inherited from

Request.setConfig


useRequest()

useRequest(onFulfilled?, onRejected?): () => void

Defined in: packages/utils/src/request.ts:424

Parameters

onFulfilled?

null | (value) => InternalAxiosRequestConfig | Promise<InternalAxiosRequestConfig>

onRejected?

null | (error) => any

Returns

Function

Returns

void

Inherited from

Request.useRequest


useResponse()

useResponse(onFulfilled?, onRejected?): () => void

Defined in: packages/utils/src/request.ts:413

Parameters

onFulfilled?

null | (value) => AxiosResponse | Promise<AxiosResponse>

onRejected?

null | (error) => any

Returns

Function

Returns

void

Inherited from

Request.useResponse

Released under the MIT License.