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
45557630
Commit
45557630
authored
Jan 16, 2026
by
song
Browse files
fix(antigravity): 使用 Contains 匹配 missing_project_id 错误信息
parent
82196890
Changes
2
Hide whitespace changes
Inline
Side-by-side
backend/internal/handler/admin/account_handler.go
View file @
45557630
...
@@ -474,7 +474,7 @@ func (h *AccountHandler) Refresh(c *gin.Context) {
...
@@ -474,7 +474,7 @@ func (h *AccountHandler) Refresh(c *gin.Context) {
}
}
// 成功获取到 project_id,如果之前是 missing_project_id 错误则清除
// 成功获取到 project_id,如果之前是 missing_project_id 错误则清除
if
account
.
Status
==
service
.
StatusError
&&
strings
.
HasPrefix
(
account
.
ErrorMessage
,
"missing_project_id:"
)
{
if
account
.
Status
==
service
.
StatusError
&&
strings
.
Contains
(
account
.
ErrorMessage
,
"missing_project_id:"
)
{
if
_
,
clearErr
:=
h
.
adminService
.
ClearAccountError
(
c
.
Request
.
Context
(),
accountID
);
clearErr
!=
nil
{
if
_
,
clearErr
:=
h
.
adminService
.
ClearAccountError
(
c
.
Request
.
Context
(),
accountID
);
clearErr
!=
nil
{
response
.
InternalError
(
c
,
"Failed to clear account error: "
+
clearErr
.
Error
())
response
.
InternalError
(
c
,
"Failed to clear account error: "
+
clearErr
.
Error
())
return
return
...
...
backend/internal/service/token_refresh_service.go
View file @
45557630
...
@@ -176,7 +176,7 @@ func (s *TokenRefreshService) refreshWithRetry(ctx context.Context, account *Acc
...
@@ -176,7 +176,7 @@ func (s *TokenRefreshService) refreshWithRetry(ctx context.Context, account *Acc
// Antigravity 账户:如果之前是因为缺少 project_id 而标记为 error,现在成功获取到了,清除错误状态
// Antigravity 账户:如果之前是因为缺少 project_id 而标记为 error,现在成功获取到了,清除错误状态
if
account
.
Platform
==
PlatformAntigravity
&&
if
account
.
Platform
==
PlatformAntigravity
&&
account
.
Status
==
StatusError
&&
account
.
Status
==
StatusError
&&
strings
.
HasPrefix
(
account
.
ErrorMessage
,
"missing_project_id:"
)
{
strings
.
Contains
(
account
.
ErrorMessage
,
"missing_project_id:"
)
{
if
clearErr
:=
s
.
accountRepo
.
ClearError
(
ctx
,
account
.
ID
);
clearErr
!=
nil
{
if
clearErr
:=
s
.
accountRepo
.
ClearError
(
ctx
,
account
.
ID
);
clearErr
!=
nil
{
log
.
Printf
(
"[TokenRefresh] Failed to clear error status for account %d: %v"
,
account
.
ID
,
clearErr
)
log
.
Printf
(
"[TokenRefresh] Failed to clear error status for account %d: %v"
,
account
.
ID
,
clearErr
)
}
else
{
}
else
{
...
...
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