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 {