From fb5357b554c4f035192c0bfd115d90a59264ebb4 Mon Sep 17 00:00:00 2001 From: zhilv Date: Fri, 29 May 2026 11:09:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=93=8D=E5=BA=94?= =?UTF-8?q?=E4=BD=93=E8=AF=BB=E5=8F=96=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- notify/wechat_company.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/notify/wechat_company.py b/notify/wechat_company.py index c407e1e..6f988d7 100644 --- a/notify/wechat_company.py +++ b/notify/wechat_company.py @@ -35,8 +35,8 @@ async def upload_file(file_path: str, filename: str = "None") -> str: async with httpx.AsyncClient(timeout=30) as client: resp = await client.post(url, files=files, headers=headers) resp.raise_for_status() - data = resp.json() - return data.get("data", data.get("files", [None])[0]) + data = resp.json().get("data") + return data.get("path", data.get("files", [None])[0]) async def send_webhook(group_id: str, file_url: str) -> dict: @@ -84,5 +84,6 @@ async def upload_and_notify(file_path: str, group_id: str, filename: str = "") - API 响应字典 """ remote_path = await upload_file(file_path, filename) + print(remote_path) result = await send_webhook(group_id, remote_path) return result