fix: 修复读取上传文件的路径错误

This commit is contained in:
2026-05-29 11:04:36 +08:00
parent 048bd53163
commit 14e064c0d2
2 changed files with 2 additions and 3 deletions

View File

@@ -31,7 +31,7 @@ async def main():
start_scheduler()
# await SD().push()
await SD().push()
# 🔥启动FastAPI Web服务
config = uvicorn.Config("app:app", host="0.0.0.0", port=8000, reload=True)

View File

@@ -36,7 +36,7 @@ async def upload_file(file_path: str, filename: str = "None") -> str:
resp = await client.post(url, files=files, headers=headers)
resp.raise_for_status()
data = resp.json()
return data.get("path", data.get("files", [None])[0])
return data.get("data", data.get("files", [None])[0])
async def send_webhook(group_id: str, file_url: str) -> dict:
@@ -52,7 +52,6 @@ async def send_webhook(group_id: str, file_url: str) -> dict:
"""
url = f"{config.WEBHOOK_API_URL}/webhook"
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {config.WEBHOOK_API_TOKEN}",
}