Files
bw-mini-app-server/.env.example
imeepos 6cd2e75d15 refactor: 重构抖音内容审核适配器使用SDK v3并集成OAuth认证
主要变更:
- 集成抖音OpenAPI SDK v3替代原有的HTTP请求方式
- 实现OAuth客户端令牌自动获取和刷新机制
- 统一环境变量配置,使用BYTEDANCE_APP_ID/APP_SECRET同时支持小程序和开放平台API
- 添加智能token缓存和过期检测
- 更新响应解析逻辑适配SDK v3格式
- 添加测试接口验证token获取功能

技术改进:
- 自动token管理,无需手动维护访问令牌
- 提前5分钟刷新token避免过期
- 完善的错误处理和类型安全
- 移除重复配置,简化环境变量管理
2025-09-08 12:43:05 +08:00

39 lines
1.4 KiB
Plaintext
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.
# 数据库配置
DB_HOST=mysql-6bc9094abd49-public.rds.volces.com
DB_PORT=53305
DB_USERNAME=root
DB_PASSWORD=WsJWXfwFx0bq6DE2kmB6
DB_DATABASE=nano_camera_miniapp
DB_LOGGING=false
DB_MIGRATIONS_RUN=false
# 应用配置
NODE_ENV=development
PORT=3003
# N8N配置
N8N_WEBHOOK_URL=https://n8n.bowongai.com/webhook/f1487ca8-bc49-4994-ba82-e2bcb95931f9
# JWT配置
JWT_SECRET=a6e4d948295ec0ae53921d67d4ce97cfff0565073e370d6094e43705cd48914b68d383feba8b6bcc8e113b090b6d4e5b306cf8b758c71aff7c0910ecb2bacfb8
# 微信小程序配置
WECHAT_APP_ID=wxb51f0b0c3aad7cdf
WECHAT_APP_SECRET=your_wechat_app_secret
# 抖音小程序配置同时用于V3 SDK
BYTEDANCE_APP_ID=ttbfd9c96420ec8f8201
BYTEDANCE_APP_SECRET=04a026867fbd1ba52174c7c21d94cbc7361ec378
BYTEDANCE_GRANT_TYPE=client_credential
# 内容审核配置
# 图片审核回调地址(重要:抖音审核完成后会调用此接口)
AUDIT_CALLBACK_URL=https://sd2s2bl25ni4n75na2bog.apigateway-cn-beijing.volceapi.com/api/v1/content-moderation/bytedance/callback
TEST_SERVER_URL=https://sd2s2bl25ni4n75na2bog.apigateway-cn-beijing.volceapi.com
PROD_SERVER_URL=https://sd2s2bl25ni4n75na2bog.apigateway-cn-beijing.volceapi.com
# 抖音内容审核API地址已更新为V3版本
# 旧版本API已弃用: https://developer.toutiao.com/api/apps/v2/content/audit/image
# 新版本V3 API通过SDK内置端点调用
# 微信内容审核API地址
WECHAT_AUDIT_API_URL=https://api.weixin.qq.com/wxa/img_sec_check