# NetConfig

object NetConfig
Content copied to clipboard

Net的全局配置

## Functions

init
Link copied to clipboard
fun init(host: String = "", config: OkHttpClient.Builder.() -> Unit = {})
Content copied to clipboard
初始化框架, 该函数仅在Kotlin下有效
fun init(host: String = "", config: OkHttpClient.Builder)
Content copied to clipboard
初始化框架, 该函数仅在Kotlin下有效

## Properties

app
Link copied to clipboard
lateinit var app: Application
Content copied to clipboard
全局上下文, 一般执行initNet即可, 无需手动赋值
converter
Link copied to clipboard
var converter: NetConverter
Content copied to clipboard
响应数据转换器
dialogFactory
Link copied to clipboard
var dialogFactory: NetDialogFactory
Content copied to clipboard
对话框构建工厂
errorHandler
Link copied to clipboard
var errorHandler: NetErrorHandler
Content copied to clipboard
错误处理器
host
Link copied to clipboard
var host: String
Content copied to clipboard
全局域名
logEnabled
Link copied to clipboard
var logEnabled: Boolean = true
Content copied to clipboard
是否启用日志
okHttpClient
Link copied to clipboard
var okHttpClient: OkHttpClient
Content copied to clipboard
全局单例请求客户端
onDialog
Link copied to clipboard
var onDialog: (FragmentActivity) -> Dialog
Content copied to clipboard
对话框, 已废弃, 请使用dialogFactory
onError
Link copied to clipboard
var onError: Throwable.() -> Unit
Content copied to clipboard
全局错误处理器, 已废弃, 请使用errorHandler
onStateError
Link copied to clipboard
var onStateError: Throwable.(view: View) -> Unit
Content copied to clipboard
网络请求自动处理缺省页时发生错误的处理逻辑
requestInterceptor
Link copied to clipboard
var requestInterceptor: RequestInterceptor? = null
Content copied to clipboard
请求拦截器
runningCalls
Link copied to clipboard
var runningCalls: ConcurrentLinkedQueue<WeakReference<Call>>
Content copied to clipboard
运行中的请求