# NetConfig

object NetConfig
Content copied to clipboard

Net的全局配置

## 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
errorHandler
Link copied to clipboard
var errorHandler: NetErrorHandler
Content copied to clipboard
全局错误处理器, 会覆盖onError/onStateError
host
Link copied to clipboard
var host: String
Content copied to clipboard
全局的域名或者ip(baseUrl)
logEnabled
Link copied to clipboard
var logEnabled: Boolean = true
Content copied to clipboard
是否启用日志
okHttpClient
Link copied to clipboard
lateinit var okHttpClient: OkHttpClient
Content copied to clipboard
onDialog
Link copied to clipboard
var onDialog: DialogCoroutineScope.(FragmentActivity) -> Dialog
Content copied to clipboard
全局加载框
onError
Link copied to clipboard
var onError: Throwable.() -> Unit
Content copied to clipboard
全局错误处理
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
Net中正在运行的请求Call