fix: replace deprecated MediaType.parse() with toMediaType() extension
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import kotlinx.coroutines.Dispatchers
|
|||||||
import kotlinx.coroutines.SupervisorJob
|
import kotlinx.coroutines.SupervisorJob
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import okhttp3.*
|
import okhttp3.*
|
||||||
|
import okhttp3.MediaType.Companion.toMediaType
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
|
|
||||||
class AuthInterceptor(
|
class AuthInterceptor(
|
||||||
@@ -89,7 +90,7 @@ class AuthInterceptor(
|
|||||||
|
|
||||||
val client = OkHttpClient()
|
val client = OkHttpClient()
|
||||||
val body = okhttp3.RequestBody.create(
|
val body = okhttp3.RequestBody.create(
|
||||||
okhttp3.MediaType.parse("application/json")!!,
|
"application/json".toMediaType(),
|
||||||
"""{"refresh_token":"$refreshToken"}"""
|
"""{"refresh_token":"$refreshToken"}"""
|
||||||
)
|
)
|
||||||
val refreshUrl = (cachedServerUrl ?: com.tiangong.aiagent.BuildConfig.BASE_URL).trimEnd('/') + "/api/v1/auth/refresh"
|
val refreshUrl = (cachedServerUrl ?: com.tiangong.aiagent.BuildConfig.BASE_URL).trimEnd('/') + "/api/v1/auth/refresh"
|
||||||
|
|||||||
Reference in New Issue
Block a user