mirror of
https://gitee.com/wanwujie/sub2api
synced 2026-04-03 06:52:13 +08: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{
|
account := &Account{
|
||||||
Name: input.Name,
|
Name: input.Name,
|
||||||
Notes: normalizeAccountNotes(input.Notes),
|
Notes: normalizeAccountNotes(input.Notes),
|
||||||
Platform: input.Platform,
|
Platform: input.Platform,
|
||||||
Type: input.Type,
|
Type: input.Type,
|
||||||
Credentials: input.Credentials,
|
Credentials: input.Credentials,
|
||||||
Extra: extra,
|
Extra: input.Extra,
|
||||||
ProxyID: input.ProxyID,
|
ProxyID: input.ProxyID,
|
||||||
Concurrency: input.Concurrency,
|
Concurrency: input.Concurrency,
|
||||||
Priority: input.Priority,
|
Priority: input.Priority,
|
||||||
|
|||||||
Reference in New Issue
Block a user