feat: 腾讯云 COS 迁移至火山引擎 TOS 对象存储

签名算法从 COS HMAC-SHA1 改为 TOS V4 HMAC-SHA256,
更新前后端上传凭证字段、配置项、备份脚本和文档。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Your Name
2026-02-10 11:02:15 +08:00
co-authored by Claude Opus 4.6
parent eba9ce8e60
commit 3a444864ac
8 changed files with 116 additions and 108 deletions
+11 -11
View File
@@ -21,11 +21,11 @@ class UploadPolicyRequest(BaseModel):
class UploadPolicyResponse(BaseModel):
"""COS 直传凭证响应"""
q_sign_algorithm: str
q_ak: str
q_key_time: str
q_signature: str
"""TOS 直传凭证响应"""
x_tos_algorithm: str
x_tos_credential: str
x_tos_date: str
x_tos_signature: str
policy: str
host: str
dir: str
@@ -56,9 +56,9 @@ async def get_upload_policy(
current_user: User = Depends(get_current_user),
):
"""
获取 COS 直传凭证
获取 TOS 直传凭证
前端使用此凭证直接上传文件到腾讯云 COS,无需经过后端。
前端使用此凭证直接上传文件到火山引擎 TOS,无需经过后端。
文件类型说明:
- script: 脚本文档 (docx, pdf, xlsx, txt, pptx)
@@ -92,10 +92,10 @@ async def get_upload_policy(
)
return UploadPolicyResponse(
q_sign_algorithm=policy["q_sign_algorithm"],
q_ak=policy["q_ak"],
q_key_time=policy["q_key_time"],
q_signature=policy["q_signature"],
x_tos_algorithm=policy["x_tos_algorithm"],
x_tos_credential=policy["x_tos_credential"],
x_tos_date=policy["x_tos_date"],
x_tos_signature=policy["x_tos_signature"],
policy=policy["policy"],
host=policy["host"],
dir=policy["dir"],