mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-28 23:32:48 +00:00
fix: include default values in parameter initialization
--bug=1060961 --user=刘瑞斌 【工具优化】在“启动参数”设置中保存默认值后,应用内调用时可直接使用预设的默认参数,无需在工具中每次单独设置,简化操作流程。 https://www.tapd.cn/62980211/s/1764217
This commit is contained in:
parent
7ee33b82dc
commit
82701e7513
|
|
@ -147,10 +147,11 @@ class BaseToolLibNodeNode(IToolLibNode):
|
|||
|
||||
self.context['params'] = params
|
||||
# 合并初始化参数
|
||||
init_params_default_value = {i["field"]: i.get('default_value') for i in tool_lib.init_field_list}
|
||||
if tool_lib.init_params is not None:
|
||||
all_params = json.loads(rsa_long_decrypt(tool_lib.init_params)) | params
|
||||
all_params = init_params_default_value | json.loads(rsa_long_decrypt(tool_lib.init_params)) | params
|
||||
else:
|
||||
all_params = params
|
||||
all_params = init_params_default_value | params
|
||||
result = function_executor.exec_code(tool_lib.code, all_params)
|
||||
return NodeResult({'result': result}, {}, _write_context=write_context)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue