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

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

parent 2328fa41
...@@ -27,13 +27,26 @@ class ApiClient private constructor() { ...@@ -27,13 +27,26 @@ class ApiClient private constructor() {
} }
private fun generateClient(): Retrofit { private fun generateClient(): Retrofit {
val httpLoggingInterceptor = val httpLoggingInterceptor = MiyaHttpLoggingInterceptor(logger = object :MiyaHttpLoggingInterceptor.Logger{
MiyaHttpLoggingInterceptor { override fun log(it: String?) {
Log.e("####", it) Log.e("####", it!!)
if (!LogFileUtils.isProhibitWrite) { if (!LogFileUtils.isProhibitWrite) {
LogFileUtils.writeLog(BaseApplication.getApplication(), it) 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) 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