给nodes里面节点的execute函数添加whitelist装饰器

This commit is contained in:
jingrow 2026-03-16 02:57:13 +08:00
parent 04c9445d88
commit ffa30beaa8
10 changed files with 10 additions and 2 deletions

View File

@ -267,7 +267,7 @@ export class FlowExecutor {
edges: this.edges
};
const response = await fetch(`/api/action/jingrow.ai.pagetype.ai_agent.nodes.${node.type}.${node.type}.execute`, {
const response = await fetch(`/api/action/jingrow.ai.nodes.${node.type}.${node.type}.execute`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',

View File

@ -5,6 +5,7 @@ import jingrow
from jingrow.utils.jingrow_cloud import call_ai_model
from jingrow.utils.jinja import render_template
@jingrow.whitelist()
def execute(context=None, inputs=None, config=None):
"""
AI内容生成节点 - 适配自 jingrow 系统

View File

@ -11,6 +11,7 @@ from jingrow.ai.api.comfyui_sd import call_jingrow_sd_api
from jingrow.ai.api.midjourney import process_midjourney_node_task
from jingrow.utils.jinja import render_template
@jingrow.whitelist()
def execute(context=None, inputs=None, config=None):
"""
AI图像生成节点 - 适配自 jingrow 系统

View File

@ -1,6 +1,7 @@
import json
import jingrow
@jingrow.whitelist()
def execute(context=None, inputs=None, config=None, **kwargs):
"""条件判断节点检查指定pagetype的记录是否满足条件"""
if context is None:

View File

@ -3,6 +3,7 @@ from typing import Dict, Any, Optional
import jingrow
@jingrow.whitelist()
def execute(context=None, inputs=None, config=None):
"""
创建记录节点 - 适配自 jingrow 系统

View File

@ -4,6 +4,7 @@ import json
import jingrow
@jingrow.whitelist()
def execute(context=None, inputs=None, config=None, **kwargs):
"""
获取指定记录的 name 简化版

View File

@ -15,6 +15,7 @@ def log_error(message):
"""记录错误日志"""
print(f"[ERROR] {message}")
@jingrow.whitelist()
def execute(context=None, inputs=None, config=None, **kwargs):
if context is None:
context = kwargs.get("context", {})

View File

@ -3,6 +3,7 @@ import sys
import os
import jingrow
@jingrow.whitelist()
def execute(context=None, inputs=None, config=None, **kwargs):
if context is None:
context = kwargs.get("context", {})

View File

@ -1252,7 +1252,7 @@ async def crawl_and_create_list(crawler, start_url: str, config: Dict[str, Any],
"failed_records": failed_records
}
@jingrow.whitelist()
def execute(context=None, inputs=None, config=None, **kwargs):
"""
网站采集并创建记录节点一体化

View File

@ -3,6 +3,7 @@ from typing import Dict, Any, Optional
import jingrow
@jingrow.whitelist()
def execute(context=None, inputs=None, config=None):
"""
更新记录节点 - 适配自 jingrow 系统