update code

This commit is contained in:
lychang
2025-11-13 23:59:28 +08:00
parent 764146278e
commit 00545db202
4 changed files with 72 additions and 18 deletions

View File

@@ -25,7 +25,7 @@ class BaseFileManager(ABC):
if headers is None:
headers = {}
resp = requests.put(url, data=raw, headers=headers)
if resp.status_code != 201:
if resp.status_code != 201 or resp.status_code != 200:
return {}
return resp.json()
@@ -146,7 +146,7 @@ class LocalFileManager(BaseFileManager):
@staticmethod
def _write(file_path: str, file_content: bytes):
try:
with open(file_path, "wb", encoding="utf-8") as f:
with open(file_path, "wb") as f:
f.write(file_content)
return True
except Exception as e: