js:添加java.getCookie(baseUrl)读取登录cookie

pull/439/head
AndyBernie 4 years ago
parent ef7bc6ec31
commit 6e99db4add
  1. 8
      app/src/main/java/io/legado/app/help/JsExtensions.kt

@ -4,6 +4,7 @@ import android.util.Base64
import androidx.annotation.Keep import androidx.annotation.Keep
import io.legado.app.constant.AppConst.dateFormat import io.legado.app.constant.AppConst.dateFormat
import io.legado.app.help.http.SSLHelper import io.legado.app.help.http.SSLHelper
import io.legado.app.help.http.CookieStore
import io.legado.app.model.analyzeRule.AnalyzeUrl import io.legado.app.model.analyzeRule.AnalyzeUrl
import io.legado.app.utils.* import io.legado.app.utils.*
import org.jsoup.Connection import org.jsoup.Connection
@ -119,6 +120,13 @@ interface JsExtensions {
.execute() .execute()
} }
/**
*js实现读取cookie
*/
fun getCookie(tag: String): String {
return CookieStore.getCookie(tag)
}
/** /**
* js实现解码,不能删 * js实现解码,不能删
*/ */

Loading…
Cancel
Save