Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
6fa704d6
Commit
6fa704d6
authored
Jan 05, 2026
by
song
Browse files
fix: Antigravity 账户刷新 token 500 错误
AccountHandler.Refresh 方法缺少对 Antigravity 平台的处理分支, 导致刷新时错误地走进 Claude 刷新逻辑。
parent
0400fcdc
Changes
2
Show whitespace changes
Inline
Side-by-side
backend/cmd/server/wire_gen.go
View file @
6fa704d6
...
...
@@ -105,7 +105,7 @@ func initializeApplication(buildInfo handler.BuildInfo) (*Application, error) {
concurrencyCache
:=
repository
.
ProvideConcurrencyCache
(
redisClient
,
configConfig
)
concurrencyService
:=
service
.
ProvideConcurrencyService
(
concurrencyCache
,
accountRepository
,
configConfig
)
crsSyncService
:=
service
.
NewCRSSyncService
(
accountRepository
,
proxyRepository
,
oAuthService
,
openAIOAuthService
,
geminiOAuthService
)
accountHandler
:=
admin
.
NewAccountHandler
(
adminService
,
oAuthService
,
openAIOAuthService
,
geminiOAuthService
,
rateLimitService
,
accountUsageService
,
accountTestService
,
concurrencyService
,
crsSyncService
)
accountHandler
:=
admin
.
NewAccountHandler
(
adminService
,
oAuthService
,
openAIOAuthService
,
geminiOAuthService
,
antigravityOAuthService
,
rateLimitService
,
accountUsageService
,
accountTestService
,
concurrencyService
,
crsSyncService
)
oAuthHandler
:=
admin
.
NewOAuthHandler
(
oAuthService
)
openAIOAuthHandler
:=
admin
.
NewOpenAIOAuthHandler
(
openAIOAuthService
,
adminService
)
geminiOAuthHandler
:=
admin
.
NewGeminiOAuthHandler
(
geminiOAuthService
)
...
...
backend/internal/handler/admin/account_handler.go
View file @
6fa704d6
...
...
@@ -38,6 +38,7 @@ type AccountHandler struct {
oauthService
*
service
.
OAuthService
openaiOAuthService
*
service
.
OpenAIOAuthService
geminiOAuthService
*
service
.
GeminiOAuthService
antigravityOAuthService
*
service
.
AntigravityOAuthService
rateLimitService
*
service
.
RateLimitService
accountUsageService
*
service
.
AccountUsageService
accountTestService
*
service
.
AccountTestService
...
...
@@ -51,6 +52,7 @@ func NewAccountHandler(
oauthService
*
service
.
OAuthService
,
openaiOAuthService
*
service
.
OpenAIOAuthService
,
geminiOAuthService
*
service
.
GeminiOAuthService
,
antigravityOAuthService
*
service
.
AntigravityOAuthService
,
rateLimitService
*
service
.
RateLimitService
,
accountUsageService
*
service
.
AccountUsageService
,
accountTestService
*
service
.
AccountTestService
,
...
...
@@ -62,6 +64,7 @@ func NewAccountHandler(
oauthService
:
oauthService
,
openaiOAuthService
:
openaiOAuthService
,
geminiOAuthService
:
geminiOAuthService
,
antigravityOAuthService
:
antigravityOAuthService
,
rateLimitService
:
rateLimitService
,
accountUsageService
:
accountUsageService
,
accountTestService
:
accountTestService
,
...
...
@@ -415,6 +418,19 @@ func (h *AccountHandler) Refresh(c *gin.Context) {
newCredentials
[
k
]
=
v
}
}
}
else
if
account
.
Platform
==
service
.
PlatformAntigravity
{
tokenInfo
,
err
:=
h
.
antigravityOAuthService
.
RefreshAccountToken
(
c
.
Request
.
Context
(),
account
)
if
err
!=
nil
{
response
.
ErrorFrom
(
c
,
err
)
return
}
newCredentials
=
h
.
antigravityOAuthService
.
BuildAccountCredentials
(
tokenInfo
)
for
k
,
v
:=
range
account
.
Credentials
{
if
_
,
exists
:=
newCredentials
[
k
];
!
exists
{
newCredentials
[
k
]
=
v
}
}
}
else
{
// Use Anthropic/Claude OAuth service to refresh token
tokenInfo
,
err
:=
h
.
oauthService
.
RefreshAccountToken
(
c
.
Request
.
Context
(),
account
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment