fix(oauth): 修复claude cookie添加账号时会话混淆的问题

This commit is contained in:
shaw
2026-01-04 14:20:17 +08:00
parent 70e9329e64
commit fac19d258d
2 changed files with 12 additions and 6 deletions

View File

@@ -233,11 +233,17 @@ func (s *claudeOAuthService) RefreshToken(ctx context.Context, refreshToken, pro
} }
func createReqClient(proxyURL string) *req.Client { func createReqClient(proxyURL string) *req.Client {
return getSharedReqClient(reqClientOptions{ // 禁用 CookieJar确保每次授权都是干净的会话
ProxyURL: proxyURL, client := req.C().
Timeout: 60 * time.Second, SetTimeout(60 * time.Second).
Impersonate: true, ImpersonateChrome().
}) SetCookieJar(nil) // 禁用 CookieJar
if strings.TrimSpace(proxyURL) != "" {
client.SetProxyURL(strings.TrimSpace(proxyURL))
}
return client
} }
func prefix(s string, n int) string { func prefix(s string, n int) string {

View File

@@ -76,7 +76,7 @@ type antigravityUsageCache struct {
} }
const ( const (
apiCacheTTL = 10 * time.Minute apiCacheTTL = 3 * time.Minute
windowStatsCacheTTL = 1 * time.Minute windowStatsCacheTTL = 1 * time.Minute
) )