fix: P0 安全加固 + 前端错误边界 + ESLint 修复

后端:
- 实现登出 API(清除 refresh token)
- 清除 videos.py 中已被 Celery 任务取代的死代码
- 添加速率限制中间件(60次/分钟,登录10次/分钟)
- 添加 SECRET_KEY/ENCRYPTION_KEY 默认值警告
- OSS STS 方法回退到 Policy 签名(不再抛异常)

前端:
- 添加全局 404/error/loading 页面
- 添加三端 error.tsx + loading.tsx 错误边界
- 修复 useId 条件调用违反 Hooks 规则
- 修复未转义引号和 Image 命名冲突
- 添加 ESLint 配置

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Your Name
2026-02-09 17:18:04 +08:00
co-authored by Claude Opus 4.6
parent a8be7bbca9
commit 8eb8100cf4
25 changed files with 498 additions and 193 deletions
+7 -5
View File
@@ -87,12 +87,14 @@ def generate_sts_token(
"""
生成 STS 临时凭证(需要配置 RAM 角色)
注意:此方法需要安装 aliyun-python-sdk-sts
果不使用 STS可以使用上面的 generate_upload_policy 方法
当前使用 Policy 签名方式,STS 方式为可选增强。
需启用 STS请安装 aliyun-python-sdk-sts 并配置 RAM 角色。
"""
# TODO: 实现 STS 临时凭证生成
# 需要安装 aliyun-python-sdk-core 和 aliyun-python-sdk-sts
raise NotImplementedError("STS 临时凭证生成暂未实现,请使用 generate_upload_policy")
# 回退到 Policy 签名方式
return generate_upload_policy(
max_size_mb=settings.MAX_FILE_SIZE_MB,
expire_seconds=duration_seconds,
)
def get_file_url(file_key: str) -> str: