Commit 59ea0474 authored by 赵鹏翔's avatar 赵鹏翔

网络层修改,基于kotlin版本的okhttp3进行优化

parent 2328fa41
......@@ -27,13 +27,26 @@ class ApiClient private constructor() {
}
private fun generateClient(): Retrofit {
val httpLoggingInterceptor =
MiyaHttpLoggingInterceptor {
Log.e("####", it)
val httpLoggingInterceptor = MiyaHttpLoggingInterceptor(logger = object :MiyaHttpLoggingInterceptor.Logger{
override fun log(it: String?) {
Log.e("####", it!!)
if (!LogFileUtils.isProhibitWrite) {
LogFileUtils.writeLog(BaseApplication.getApplication(), it)
}
}.apply { level = MiyaHttpLoggingInterceptor.Level.BODY }
}
}).apply {
level = MiyaHttpLoggingInterceptor.Level.BODY
}
// val httpLoggingInterceptor =
// MiyaHttpLoggingInterceptor {
// Log.e("####", it)
// if (!LogFileUtils.isProhibitWrite) {
// LogFileUtils.writeLog(BaseApplication.getApplication(), it)
// }
// }
// .apply { level = MiyaHttpLoggingInterceptor.Level.BODY }
val socketFactory = arrayOfNulls<SSLSocketFactory>(1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment