pull/1274/head
gedoor 3 years ago
parent f566b01447
commit 7e469d144b
  1. 14
      app/src/main/java/io/legado/app/data/entities/BaseSource.kt
  2. 2
      app/src/main/java/io/legado/app/data/entities/BookSource.kt
  3. 2
      app/src/main/java/io/legado/app/data/entities/RssSource.kt

@ -17,9 +17,21 @@ import javax.script.SimpleBindings
@Suppress("unused") @Suppress("unused")
interface BaseSource : JsExtensions { interface BaseSource : JsExtensions {
var loginUrl: String?
var header: String?
fun getStoreUrl(): String fun getStoreUrl(): String
var header: String? fun getLoginJs(): String? {
val loginJs = loginUrl
return when {
loginJs == null -> null
loginJs.startsWith("@js:") -> loginJs.substring(4)
loginJs.startsWith("<js>") ->
loginJs.substring(4, loginJs.lastIndexOf("<"))
else -> loginJs
}
}
/** /**
* 解析header规则 * 解析header规则

@ -28,7 +28,7 @@ data class BookSource(
var enabled: Boolean = true, // 是否启用 var enabled: Boolean = true, // 是否启用
var enabledExplore: Boolean = true, // 启用发现 var enabledExplore: Boolean = true, // 启用发现
override var header: String? = null, // 请求头 override var header: String? = null, // 请求头
var loginUrl: String? = null, // 登录地址 override var loginUrl: String? = null, // 登录地址
var loginUi: List<RowUi>? = null, //登录UI var loginUi: List<RowUi>? = null, //登录UI
var loginCheckJs: String? = null, //登录检测js var loginCheckJs: String? = null, //登录检测js
var bookSourceComment: String? = null, // 注释 var bookSourceComment: String? = null, // 注释

@ -21,7 +21,7 @@ data class RssSource(
var sourceComment: String? = null, var sourceComment: String? = null,
var enabled: Boolean = true, var enabled: Boolean = true,
override var header: String? = null, // 请求头 override var header: String? = null, // 请求头
var loginUrl: String? = null, // 登录地址 override var loginUrl: String? = null, // 登录地址
var loginUi: List<RowUi>? = null, //登录UI var loginUi: List<RowUi>? = null, //登录UI
var loginCheckJs: String? = null, //登录检测js var loginCheckJs: String? = null, //登录检测js
var sortUrl: String? = null, var sortUrl: String? = null,

Loading…
Cancel
Save