|
|
@ -589,17 +589,12 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions { |
|
|
|
* 执行JS |
|
|
|
* 执行JS |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private fun evalJS(jsStr: String, result: Any?): Any? { |
|
|
|
private fun evalJS(jsStr: String, result: Any?): Any? { |
|
|
|
try { |
|
|
|
|
|
|
|
val bindings = SimpleBindings() |
|
|
|
val bindings = SimpleBindings() |
|
|
|
bindings["java"] = this |
|
|
|
bindings["java"] = this |
|
|
|
bindings["book"] = book |
|
|
|
bindings["book"] = book |
|
|
|
bindings["result"] = result |
|
|
|
bindings["result"] = result |
|
|
|
bindings["baseUrl"] = baseUrl |
|
|
|
bindings["baseUrl"] = baseUrl |
|
|
|
return SCRIPT_ENGINE.eval(jsStr, bindings) |
|
|
|
return SCRIPT_ENGINE.eval(jsStr, bindings) |
|
|
|
} catch (e: Exception) { |
|
|
|
|
|
|
|
e.printStackTrace() |
|
|
|
|
|
|
|
throw e |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|