library-picturebook-activity/oss-direct-upload-demo/backend/application-oss.yml
En b9ed5e17c6 feat: OSS 客户端直传改造(STS Token 签发 + 前端直传 + CORS 自动配置)
后端新增 OssUtils/OssTokenVo/OssCorsInitRunner,通过 STS 临时凭证实现客户端直传 OSS;
前端 upload API 适配直传流程,赛事创建/作品提交/作业/富文本编辑器均已切换;
多环境(dev/test/prod) OSS 配置补全;新增 oss-direct-upload-demo 示例项目及 E2E 测试。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 15:19:43 +08:00

33 lines
1.4 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ============================================================
# 阿里云 OSS 配置片段
# ============================================================
# 将以下内容复制到你的 application.yml或 application-dev.yml
# 所有敏感配置建议使用环境变量,不要硬编码
# ============================================================
aliyun:
oss:
# OSS Endpoint不带 http:// 前缀)
endpoint: ${OSS_ENDPOINT:oss-cn-hangzhou.aliyuncs.com}
# 阿里云 AccessKey建议使用环境变量
access-key-id: ${OSS_ACCESS_KEY_ID:your-access-key-id}
access-key-secret: ${OSS_ACCESS_KEY_SECRET:your-access-key-secret}
# Bucket 名称
bucket-name: ${OSS_BUCKET_NAME:your-bucket-name}
# 文件最大大小(字节),默认 10MB
max-file-size: ${OSS_MAX_FILE_SIZE:10485760}
# 前端直传跨域:启动时自动配置 OSS CORS
# 设为 true 时,应用启动会自动调用 OSS API 设置 CORS 规则
# 设为 false 时,需要在阿里云控制台手动配置
cors-enabled: ${OSS_CORS_ENABLED:true}
# CORS 允许的来源,逗号分隔
# 开发环境http://localhost:5173,http://localhost:5174
# 生产环境https://your-domain.com
# 使用 * 表示允许所有来源(仅建议开发环境)
cors-allowed-origins: ${OSS_CORS_ORIGINS:http://localhost:5173,http://localhost:5174}