mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
优化
This commit is contained in:
parent
688b05122e
commit
2450fd8310
@ -56,7 +56,12 @@ interface JsExtensions : JsEncodeUtils {
|
||||
/**
|
||||
* 访问网络,返回String
|
||||
*/
|
||||
fun ajax(urlStr: String): String? {
|
||||
fun ajax(url: Any): String? {
|
||||
val urlStr = if (url is List<*>) {
|
||||
url.firstOrNull().toString()
|
||||
} else {
|
||||
url.toString()
|
||||
}
|
||||
return runBlocking {
|
||||
kotlin.runCatching {
|
||||
val analyzeUrl = AnalyzeUrl(urlStr, source = getSource())
|
||||
|
@ -666,7 +666,12 @@ class AnalyzeRule(
|
||||
/**
|
||||
* js实现跨域访问,不能删
|
||||
*/
|
||||
override fun ajax(urlStr: String): String? {
|
||||
override fun ajax(url: Any): String? {
|
||||
val urlStr = if (url is List<*>) {
|
||||
url.firstOrNull().toString()
|
||||
} else {
|
||||
url.toString()
|
||||
}
|
||||
return runBlocking {
|
||||
kotlin.runCatching {
|
||||
val analyzeUrl = AnalyzeUrl(urlStr, source = source, ruleData = book)
|
||||
|
Loading…
Reference in New Issue
Block a user