提交打包
This commit is contained in:
4
app/.env
4
app/.env
@@ -12,8 +12,8 @@ client_name=ShuFuAI
|
||||
|
||||
|
||||
# java_api_base=http://47.111.163.154:18080
|
||||
java_api_base=http://127.0.0.1:18080
|
||||
# java_api_base=http://127.0.0.1:18080
|
||||
# java_api_base=http://8.136.19.173:18080
|
||||
# java_api_base=http://121.196.149.225:18080
|
||||
java_api_base=http://121.196.149.225:18080
|
||||
|
||||
|
||||
|
||||
@@ -218,15 +218,17 @@ def proxy(path):
|
||||
f"{JAVA_API_BASE}/api/product-risk-resolve/tasks/progress/batch",
|
||||
]
|
||||
proxy_timeout = 180 if target_url.endswith("/api/delete-brand/run") else 30
|
||||
if target_url not in ignore_url:
|
||||
try:
|
||||
print("=============================")
|
||||
print("target_url:",target_url)
|
||||
print("params:",params)
|
||||
print("data:",request.get_data())
|
||||
print("=============================")
|
||||
except Exception as e:
|
||||
print("打印失败",e)
|
||||
if target_url not in ignore_url:
|
||||
try:
|
||||
print("=============================")
|
||||
print("target_url:", target_url)
|
||||
print("params:", params)
|
||||
print("data:", request.get_data())
|
||||
print("method:", request.method)
|
||||
print("timeout:", proxy_timeout)
|
||||
print("=============================")
|
||||
except Exception as e:
|
||||
print("打印失败", e)
|
||||
|
||||
try:
|
||||
# 使用流式请求
|
||||
@@ -257,12 +259,12 @@ def proxy(path):
|
||||
|
||||
return response
|
||||
|
||||
except requests.exceptions.Timeout:
|
||||
print("后端服务超时")
|
||||
return Response("后端服务超时", status=504)
|
||||
except requests.exceptions.ConnectionError:
|
||||
print("无法连接到后端服务")
|
||||
return Response("无法连接到后端服务", status=502)
|
||||
except Exception as e:
|
||||
print(f"代理请求失败: {e}")
|
||||
except requests.exceptions.Timeout:
|
||||
print(f"后端服务超时:target_url={target_url}, timeout={proxy_timeout}")
|
||||
return Response("后端服务超时", status=504)
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
print(f"无法连接到后端服务:target_url={target_url}, error={e}")
|
||||
return Response("无法连接到后端服务", status=502)
|
||||
except Exception as e:
|
||||
print(f"代理请求失败:target_url={target_url}, error={e}")
|
||||
return Response(f"代理错误: {str(e)}", status=500)
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
base_url = "https://api.coze.cn/v1"
|
||||
coze_token = "sat_12nW40INoJxArrDXbY4lSCoudbqkOYTcphC99BP2efWyzxmsk4q81WDX3ezWgqZ5"
|
||||
workflow_id = "7608812635877900322"
|
||||
STITCH_WORKFLOW_ID = "7608813873483300907"
|
||||
|
||||
base_url = "https://api.coze.cn/v1"
|
||||
coze_token = "sat_12nW40INoJxArrDXbY4lSCoudbqkOYTcphC99BP2efWyzxmsk4q81WDX3ezWgqZ5"
|
||||
workflow_id = "7608812635877900322"
|
||||
STITCH_WORKFLOW_ID = "7608813873483300907"
|
||||
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
from queue import Queue
|
||||
load_dotenv()
|
||||
_base_url = os.getenv("base_url","http://159.75.121.33:15124")
|
||||
|
||||
base_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
dotenv_path = os.path.join(base_dir, ".env")
|
||||
load_dotenv(dotenv_path=dotenv_path, override=True)
|
||||
|
||||
_base_url = os.getenv("base_url","http://159.75.121.33:15124")
|
||||
|
||||
# MySQL 配置
|
||||
mysql_host = os.getenv("mysql_host")
|
||||
|
||||
Reference in New Issue
Block a user