|
|
@ -41,8 +41,7 @@ class AnalyzeUrl( |
|
|
|
private val jsonType = MediaType.parse("application/json; charset=utf-8") |
|
|
|
private val jsonType = MediaType.parse("application/json; charset=utf-8") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
lateinit var baseUrl: String |
|
|
|
private var baseUrl: String = "" |
|
|
|
private set |
|
|
|
|
|
|
|
lateinit var url: String |
|
|
|
lateinit var url: String |
|
|
|
private set |
|
|
|
private set |
|
|
|
var path: String? = null |
|
|
|
var path: String? = null |
|
|
@ -101,14 +100,11 @@ class AnalyzeUrl( |
|
|
|
if (ruleUrl.contains("{{") && ruleUrl.contains("}}")) { |
|
|
|
if (ruleUrl.contains("{{") && ruleUrl.contains("}}")) { |
|
|
|
var jsEval: Any |
|
|
|
var jsEval: Any |
|
|
|
val sb = StringBuffer(ruleUrl.length) |
|
|
|
val sb = StringBuffer(ruleUrl.length) |
|
|
|
val simpleBindings = object : SimpleBindings() { |
|
|
|
val simpleBindings = SimpleBindings() |
|
|
|
init { |
|
|
|
simpleBindings["baseUrl"] = baseUrl |
|
|
|
this["baseUrl"] = baseUrl |
|
|
|
simpleBindings["page"] = page |
|
|
|
this["page"] = page |
|
|
|
simpleBindings["key"] = key |
|
|
|
this["key"] = key |
|
|
|
simpleBindings["book"] = book |
|
|
|
this["book"] = book |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
val expMatcher = EXP_PATTERN.matcher(ruleUrl) |
|
|
|
val expMatcher = EXP_PATTERN.matcher(ruleUrl) |
|
|
|
while (expMatcher.find()) { |
|
|
|
while (expMatcher.find()) { |
|
|
|
jsEval = SCRIPT_ENGINE.eval(expMatcher.group(1), simpleBindings) |
|
|
|
jsEval = SCRIPT_ENGINE.eval(expMatcher.group(1), simpleBindings) |
|
|
|