mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-03-30 02:46:51 +00:00
fix: 移除账号导入时同步调用 disableOpenAITraining,避免网络超时导致导入失败
privacy_mode 改为由 TokenRefreshService 在 token 刷新后异步补设。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1425,30 +1425,13 @@ func (s *adminServiceImpl) CreateAccount(ctx context.Context, input *CreateAccou
|
||||
}
|
||||
}
|
||||
|
||||
// OpenAI OAuth: attempt to disable training data sharing
|
||||
extra := input.Extra
|
||||
if input.Platform == PlatformOpenAI && input.Type == AccountTypeOAuth {
|
||||
if token, _ := input.Credentials["access_token"].(string); token != "" {
|
||||
var proxyURL string
|
||||
if input.ProxyID != nil {
|
||||
if p, err := s.proxyRepo.GetByID(ctx, *input.ProxyID); err == nil && p != nil {
|
||||
proxyURL = p.URL()
|
||||
}
|
||||
}
|
||||
if extra == nil {
|
||||
extra = make(map[string]any)
|
||||
}
|
||||
extra["privacy_mode"] = disableOpenAITraining(ctx, s.privacyClientFactory, token, proxyURL)
|
||||
}
|
||||
}
|
||||
|
||||
account := &Account{
|
||||
Name: input.Name,
|
||||
Notes: normalizeAccountNotes(input.Notes),
|
||||
Platform: input.Platform,
|
||||
Type: input.Type,
|
||||
Credentials: input.Credentials,
|
||||
Extra: extra,
|
||||
Extra: input.Extra,
|
||||
ProxyID: input.ProxyID,
|
||||
Concurrency: input.Concurrency,
|
||||
Priority: input.Priority,
|
||||
|
||||
Reference in New Issue
Block a user