From dd4fa27856d700b71a82ff6612db8f5854b0e451 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 6 Sep 2019 08:37:16 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/data/api/IHttpGetApi.kt | 4 ++-- app/src/main/java/io/legado/app/data/api/IHttpPostApi.kt | 4 ++-- app/src/main/java/io/legado/app/help/JsExtensions.kt | 2 +- .../main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/legado/app/data/api/IHttpGetApi.kt b/app/src/main/java/io/legado/app/data/api/IHttpGetApi.kt index a5b0e60c6..e4180fa59 100644 --- a/app/src/main/java/io/legado/app/data/api/IHttpGetApi.kt +++ b/app/src/main/java/io/legado/app/data/api/IHttpGetApi.kt @@ -31,12 +31,12 @@ interface IHttpGetApi { fun get( @Url url: String, @HeaderMap headers: Map - ): Call> + ): Call @GET fun getMap( @Url url: String, @QueryMap(encoded = true) queryMap: Map, @HeaderMap headers: Map - ): Call> + ): Call } diff --git a/app/src/main/java/io/legado/app/data/api/IHttpPostApi.kt b/app/src/main/java/io/legado/app/data/api/IHttpPostApi.kt index 113a77291..0aa3ef3db 100644 --- a/app/src/main/java/io/legado/app/data/api/IHttpPostApi.kt +++ b/app/src/main/java/io/legado/app/data/api/IHttpPostApi.kt @@ -34,12 +34,12 @@ interface IHttpPostApi { @Url url: String, @FieldMap(encoded = true) fieldMap: Map, @HeaderMap headers: Map - ): Call> + ): Call @POST fun postBody( @Url url: String, @Body body: RequestBody, @HeaderMap headers: Map - ): Call> + ): Call } diff --git a/app/src/main/java/io/legado/app/help/JsExtensions.kt b/app/src/main/java/io/legado/app/help/JsExtensions.kt index a09d338c3..643630121 100644 --- a/app/src/main/java/io/legado/app/help/JsExtensions.kt +++ b/app/src/main/java/io/legado/app/help/JsExtensions.kt @@ -17,7 +17,7 @@ class JsExtensions { val analyzeUrl = AnalyzeUrl(urlStr, null, null, null, null, null) val call = analyzeUrl.getResponse() val response = call.execute() - response.body()?.toString() + response.body() } catch (e: Exception) { e.localizedMessage } diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt index 29b6fe1f4..bdd18608c 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt @@ -200,7 +200,7 @@ class AnalyzeUrl( GET, POST } - fun getResponse(): Call> { + fun getResponse(): Call { return when { method == Method.POST -> { if (fieldMap.isNotEmpty()) {