feat(Antigravity): 为无 project_id 的账户生成随机 project_id
部分账户类型(如 g1-pro-tier)API 不返回 cloudaicompanionProject, 但实际接受任意格式的 project_id,故添加随机生成逻辑作为兜底。
This commit is contained in:
@@ -149,6 +149,12 @@ func (s *AntigravityOAuthService) ExchangeCode(ctx context.Context, input *Antig
|
||||
result.ProjectID = loadResp.CloudAICompanionProject
|
||||
}
|
||||
|
||||
// 兜底:随机生成 project_id
|
||||
if result.ProjectID == "" {
|
||||
result.ProjectID = antigravity.GenerateMockProjectID()
|
||||
fmt.Printf("[AntigravityOAuth] 使用随机生成的 project_id: %s\n", result.ProjectID)
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user