fix: streamline gemini flow and add e2e test

This commit is contained in:
2026-03-08 23:58:17 +08:00
parent 82284ce3fb
commit 2ab27eb914
3 changed files with 151 additions and 8 deletions

View File

@@ -18,6 +18,7 @@ load_dotenv()
# 图绘平台配置
TUHUI_BASE_URL = os.getenv("TUHUI_BASE_URL", "https://tuhui.cloud")
TUHUI_FALLBACK_BASE_URL = "https://tuhui.cloud"
TUHUI_DIRECT_BASE_URL = os.getenv("TUHUI_DIRECT_BASE_URL", "http://1.12.50.92:8002")
TUHUI_WEB_BASE_URL = os.getenv("TUHUI_WEB_BASE_URL", "https://tuhui.cloud").rstrip("/")
TUHUI_PHONE = os.getenv("TUHUI_PHONE", "17520145271") # 图绘账号手机号
TUHUI_PASSWORD = os.getenv("TUHUI_PASSWORD", "zuowei1216") # 图绘账号密码
@@ -59,7 +60,11 @@ class TuhuiUploadService:
def __init__(self):
self.base_url = TUHUI_BASE_URL.rstrip("/")
self.base_urls = []
for candidate in (TUHUI_FALLBACK_BASE_URL.rstrip("/"), self.base_url):
for candidate in (
TUHUI_FALLBACK_BASE_URL.rstrip("/"),
TUHUI_DIRECT_BASE_URL.rstrip("/"),
self.base_url,
):
if candidate and candidate not in self.base_urls:
self.base_urls.append(candidate)
if self.base_urls:
@@ -160,7 +165,7 @@ class TuhuiUploadService:
return TuhuiUploadResult(False, "", 0, message="登录失败")
# 准备上传数据
price = price or self.default_price
price = self.default_price if price is None else price
# 读取图片文件
if not os.path.exists(image_path):