mirror of
https://github.com/Wei-Shaw/claude-relay-service.git
synced 2026-01-22 16:43:35 +00:00
## 问题描述 移除 formatSubscriptionExpiry 函数后,API返回的 expiresAt 字段变成了OAuth token过期时间(通常1小时) 而不是订阅过期时间,导致前端显示错误的过期时间,并可能将短期token过期时间错误保存为订阅过期时间。 ## 修复方案 1. 添加 formatAccountExpiry 函数,正确映射字段: - expiresAt: 映射为 subscriptionExpiresAt(订阅过期时间)供前端使用 - tokenExpiresAt: 保留OAuth token过期时间供内部使用 2. 在所有账户端点应用格式化: - 所有账户类型的GET端点(Claude, Claude Console, CCR, Bedrock, Gemini, OpenAI等) - 所有账户类型的POST创建端点 - 错误处理分支也正确格式化 ## 影响范围 - 修复了9种账户类型的所有相关端点 - 共应用了28处格式化调用 - 确保前端获取正确的订阅过期时间,而非token过期时间 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>