调用时,retrofit 不会跳转到验证器。它没有被调用。哪个可能是忽略 Authenticator 的原因?
private val clientWithAuth by lazy {
Retrofit.Builder().baseUrl(Config.API_URL)
.client(
OkHttpClient().newBuilder()
.addInterceptor(AccessTokenInterceptor())
.addInterceptor(
LoggingInterceptor.Builder()
.setLevel(Level.BODY)
.request("Request")
.response("Response")
.addHeader("Content-Type", "application/json").build()
)
.authenticator(AccesTokenAuthenticator())
.build()
).addConverterFactory(GsonConverterFactory.create()).build().create(Api::class.java)
}