From 9e3e843d5e82c86adcfbcc99f9559972e0c0273f Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 3 Nov 2019 10:25:31 +0800 Subject: [PATCH] up --- .../java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 ed444a822..da5244b18 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 @@ -54,8 +54,9 @@ class AnalyzeUrl( private val headerMap = HashMap() private var charset: String? = null private var bodyTxt: String? = null - private lateinit var body: RequestBody + private var body: RequestBody? = null private var method = Method.GET + private var webViewJs: String? = null val postData: ByteArray get() { @@ -178,6 +179,7 @@ class AnalyzeUrl( } options["body"]?.let { bodyTxt = it } options["charset"]?.let { charset = it } + options["js"]?.let { webViewJs = it } } } when (method) { @@ -262,7 +264,7 @@ class AnalyzeUrl( } else { HttpHelper .getApiService(baseUrl) - .postBody(url, body, headerMap) + .postBody(url, body!!, headerMap) } } fieldMap.isEmpty() -> HttpHelper @@ -284,7 +286,7 @@ class AnalyzeUrl( } else { HttpHelper .getApiService(baseUrl) - .postBodyAsync(url, body, headerMap) + .postBodyAsync(url, body!!, headerMap) } } fieldMap.isEmpty() -> HttpHelper