Merge upstream/main: sync latest updates
Some checks failed
CI / test (push) Has been cancelled
CI / golangci-lint (push) Has been cancelled
Security Scan / backend-security (push) Has been cancelled
Security Scan / frontend-security (push) Has been cancelled

- feat(gateway): aggregate all text chunks in non-streaming Gemini responses
- feat(gateway): add SUGGESTION MODE request interception
- feat(oauth): support Anthropic Team accounts with sk authorization
- fix(oauth): update Anthropic OAuth parameters to sync with latest client
- feat: add PromoCodeEnabled setting (default: true)
- resolved conflict: keep TianShuAPI site name while adding PromoCode feature

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
huangzhenpc
2026-01-24 10:21:16 +08:00
65 changed files with 5650 additions and 805 deletions

View File

@@ -153,8 +153,8 @@ func (s *AuthService) RegisterWithVerification(ctx context.Context, email, passw
return "", nil, ErrServiceUnavailable
}
// 应用优惠码(如果提供)
if promoCode != "" && s.promoService != nil {
// 应用优惠码(如果提供且功能已启用
if promoCode != "" && s.promoService != nil && s.settingService != nil && s.settingService.IsPromoCodeEnabled(ctx) {
if err := s.promoService.ApplyPromoCode(ctx, user.ID, promoCode); err != nil {
// 优惠码应用失败不影响注册,只记录日志
log.Printf("[Auth] Failed to apply promo code for user %d: %v", user.ID, err)