From 6db32b4501c0aed52e16d62953b71a5f621e05e1 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 6 Sep 2019 08:24:23 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/help/JsExtensions.kt | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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 238996a5a..a09d338c3 100644 --- a/app/src/main/java/io/legado/app/help/JsExtensions.kt +++ b/app/src/main/java/io/legado/app/help/JsExtensions.kt @@ -13,18 +13,14 @@ class JsExtensions { * js实现跨域访问,不能删 */ fun ajax(urlStr: String): String? { - try { + return try { val analyzeUrl = AnalyzeUrl(urlStr, null, null, null, null, null) val call = analyzeUrl.getResponse() val response = call.execute() - if (response.body() != null) { - return response.body()!!.toString() - } + response.body()?.toString() } catch (e: Exception) { - return e.localizedMessage + e.localizedMessage } - - return null } /**