From 455576300c047cb113b8975a520f23ad677a2a64 Mon Sep 17 00:00:00 2001 From: song Date: Fri, 16 Jan 2026 14:03:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(antigravity):=20=E4=BD=BF=E7=94=A8=20Contai?= =?UTF-8?q?ns=20=E5=8C=B9=E9=85=8D=20missing=5Fproject=5Fid=20=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/internal/handler/admin/account_handler.go | 2 +- backend/internal/service/token_refresh_service.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/internal/handler/admin/account_handler.go b/backend/internal/handler/admin/account_handler.go index 55311b3a..15ce8960 100644 --- a/backend/internal/handler/admin/account_handler.go +++ b/backend/internal/handler/admin/account_handler.go @@ -474,7 +474,7 @@ func (h *AccountHandler) Refresh(c *gin.Context) { } // 成功获取到 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 { response.InternalError(c, "Failed to clear account error: "+clearErr.Error()) return diff --git a/backend/internal/service/token_refresh_service.go b/backend/internal/service/token_refresh_service.go index 6e405efb..4ae4bec8 100644 --- a/backend/internal/service/token_refresh_service.go +++ b/backend/internal/service/token_refresh_service.go @@ -176,7 +176,7 @@ func (s *TokenRefreshService) refreshWithRetry(ctx context.Context, account *Acc // Antigravity 账户:如果之前是因为缺少 project_id 而标记为 error,现在成功获取到了,清除错误状态 if account.Platform == PlatformAntigravity && 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 { log.Printf("[TokenRefresh] Failed to clear error status for account %d: %v", account.ID, clearErr) } else {