feat: dify_approve_workflow_url 以及 dify_approve_workflow_key

This commit is contained in:
martsforever
2025-12-10 17:31:37 +08:00
parent bad82e6fc2
commit aaa8390dd2
3 changed files with 9 additions and 2 deletions
+3
View File
@@ -40,3 +40,6 @@ JWT_WHITE_LIST = ["/token", "/login", "/refresh", "/registry", "/verify", "/asyn
FILE_SAVE_PATH=/www/wwwroot/web/web/upload_file/ # 文件保存在服务器上的路径
FILE_PUBLIC_PATH=/web/upload_file/ # 文件在浏览器上的访问路径
DEFAULT_UPDATE_BY_FIELDS=true # 更新接口是否默认按字段更新(按需更新字段值)
DIFY_APPROVE_WORKFLOW_URL = http://62.234.223.227:8055/v1/workflows/run # dify审批工作流接口
DIFY_APPROVE_WORKFLOW_KEY = app-B7Sm2QBbRdM3VBH4mG7yNsuC # dify审批工作流接口key
+3
View File
@@ -49,6 +49,9 @@ class Settings(BaseSettings):
file_public_path: str = Field(..., env='FILE_PUBLIC_PATH')
default_update_by_fields: bool = Field(..., env='DEFAULT_UPDATE_BY_FIELDS')
dify_approve_workflow_url: str = Field(..., env='DIFY_APPROVE_WORKFLOW_URL')
dify_approve_workflow_key: str = Field(..., env='DIFY_APPROVE_WORKFLOW_KEY')
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
+3 -2
View File
@@ -8,6 +8,7 @@ from langgraph.constants import START
from langgraph.graph import StateGraph
from langgraph.types import interrupt, Command
from app.config.env import env
from app.model.ApproveModel import ApproveService
from app.model.UserModel import UserService, UserServiceModel
from app.utils.db_utils import AsyncSessionDep
@@ -92,9 +93,9 @@ def create_approve_graph(
else:
async with httpx.AsyncClient() as client:
response = await client.post(
url="http://110.42.233.30:8055/v1/workflows/run",
url=env.dify_approve_workflow_url,
headers={
"Authorization": f"Bearer app-ujHKbO9PFFmgarVutW5TdBaC"
"Authorization": f"Bearer {env.dify_approve_workflow_key}"
},
json={
"inputs": {