feat: 支持CloudFlare图床自定义上传文件夹路径

- 新增CLOUDFLARE_IMGBED_UPLOAD_FOLDER环境变量配置
- 用户可通过该配置项指定图片在CloudFlare图床中的上传路径
This commit is contained in:
ry
2025-07-05 23:32:20 +08:00
parent 0e8a943d7f
commit 8a827d2acb
9 changed files with 40 additions and 9 deletions

View File

@@ -238,6 +238,7 @@ def _extract_image_data(part: dict) -> str:
provider=settings.UPLOAD_PROVIDER,
base_url=settings.CLOUDFLARE_IMGBED_URL,
auth_code=settings.CLOUDFLARE_IMGBED_AUTH_CODE,
upload_folder=settings.CLOUDFLARE_IMGBED_UPLOAD_FOLDER,
)
current_date = time.strftime("%Y/%m/%d")
filename = f"{current_date}/{uuid.uuid4().hex[:8]}.png"