ApiInterceptor class

API拦截器

Inheritance

Constructors

ApiInterceptor(RespData mapToRespData(Map), dynamic doShowErrorMsg(String), {bool showLog = false})

Properties

doShowErrorMsg → dynamic Function(String)
final
hashCode int
The hash code for this object.
no setterinherited
isShowErrorMsg ↔ dynamic
getter/setter pair
mapToRespData RespData Function(Map)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showLog bool
final

Methods

handleFailed(RespData respData, ResponseInterceptorHandler handler, RequestOptions requestOptions) → void
后台接口返回错误码
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onError(DioError err, ErrorInterceptorHandler handler) → void
网络相关错误
override
onRequest(RequestOptions options, RequestInterceptorHandler handler) → void
The callback will be executed before the request is initiated.
override
onResponse(Response response, ResponseInterceptorHandler handler) → void
The callback will be executed on success. If you want to continue the response, call handler.next.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited