优化
This commit is contained in:
@@ -179,6 +179,10 @@ interface BaseSource : JsExtensions {
|
|||||||
CacheManager.delete("userInfo_${getKey()}")
|
CacheManager.delete("userInfo_${getKey()}")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置自定义变量
|
||||||
|
* @param variable 变量内容
|
||||||
|
*/
|
||||||
fun setVariable(variable: String?) {
|
fun setVariable(variable: String?) {
|
||||||
if (variable != null) {
|
if (variable != null) {
|
||||||
CacheManager.put("sourceVariable_${getKey()}", variable)
|
CacheManager.put("sourceVariable_${getKey()}", variable)
|
||||||
@@ -187,6 +191,9 @@ interface BaseSource : JsExtensions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取自定义变量
|
||||||
|
*/
|
||||||
fun getVariable(): String? {
|
fun getVariable(): String? {
|
||||||
return CacheManager.get("sourceVariable_${getKey()}")
|
return CacheManager.get("sourceVariable_${getKey()}")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ interface RuleDataInterface {
|
|||||||
return when {
|
return when {
|
||||||
value == null -> {
|
value == null -> {
|
||||||
variableMap.remove(key)
|
variableMap.remove(key)
|
||||||
putBigVariable(key, value)
|
putBigVariable(key, null)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
value.length < 10000 -> {
|
value.length < 10000 -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user