Prechádzať zdrojové kódy

+ 默认使用OkHttp3作为网络请求实现

drake 5 rokov pred
rodič
commit
2b25320fa1

+ 2 - 0
net/src/main/java/com/drake/net/NetConfig.kt

@@ -18,6 +18,7 @@ import com.drake.net.scope.DialogCoroutineScope
 import com.drake.tooltip.toast
 import com.yanzhenjie.kalle.Kalle
 import com.yanzhenjie.kalle.KalleConfig
+import com.yanzhenjie.kalle.OkHttpConnectFactory
 import com.yanzhenjie.kalle.exception.*
 import com.yanzhenjie.kalle.simple.cache.DiskCacheStore
 import java.util.concurrent.ExecutionException
@@ -99,6 +100,7 @@ fun Application.initNet(host: String, config: KalleConfig.Builder.() -> Unit = {
     NetConfig.host = host
     NetConfig.app = this
     val builder = KalleConfig.newBuilder()
+    builder.connectFactory(OkHttpConnectFactory.newBuilder().build())
     builder.config()
     Kalle.setConfig(builder.build())
 }