Compare commits

..

1 Commits

Author SHA1 Message Date
qhy040404
99b2ccb33b add patch statistics 2024-04-20 11:06:16 +08:00
3 changed files with 6 additions and 4 deletions

View File

@@ -25,7 +25,7 @@ internal sealed partial class CardClient
{
HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create()
.SetRequestUri(ApiEndpoints.CardCreateVerification(true))
.SetUserCookieAndFpHeader(user, CookieType.Cookie)
.SetUserCookieAndFpHeader(user, CookieType.LToken)
.SetHeader("x-rpc-challenge_game", $"{headers.ChallengeGame}")
.SetHeader("x-rpc-challenge_path", headers.ChallengePath)
.Get();
@@ -39,11 +39,10 @@ internal sealed partial class CardClient
return Response.Response.DefaultIfNull(resp);
}
public async ValueTask<Response<VerificationResult>> VerifyVerificationAsync(User user, CardVerifiationHeaders headers, string challenge, string validate, CancellationToken token)
public async ValueTask<Response<VerificationResult>> VerifyVerificationAsync(CardVerifiationHeaders headers, string challenge, string validate, CancellationToken token)
{
HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create()
.SetRequestUri(ApiEndpoints.CardVerifyVerification)
.SetUserCookieAndFpHeader(user, CookieType.Cookie)
.SetHeader("x-rpc-challenge_game", $"{headers.ChallengeGame}")
.SetHeader("x-rpc-challenge_path", headers.ChallengePath)
.PostJson(new VerificationData(challenge, validate));

View File

@@ -24,7 +24,7 @@ internal sealed partial class HomaGeetestCardVerifier : IGeetestCardVerifier
if (response is { Code: 0, Data.Validate: string validate })
{
Response.Response<VerificationResult> verifyResponse = await cardClient.VerifyVerificationAsync(user, headers, registration.Challenge, validate, token).ConfigureAwait(false);
Response.Response<VerificationResult> verifyResponse = await cardClient.VerifyVerificationAsync(headers, registration.Challenge, validate, token).ConfigureAwait(false);
if (verifyResponse.IsOk())
{
VerificationResult result = verifyResponse.Data;

View File

@@ -1,6 +1,7 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.Core;
using Snap.Hutao.Core.DependencyInjection.Annotation.HttpClient;
using Snap.Hutao.Web.Hutao.Response;
using Snap.Hutao.Web.Request.Builder;
@@ -15,6 +16,7 @@ internal sealed partial class HutaoInfrastructureClient
{
private readonly IHttpRequestMessageBuilderFactory httpRequestMessageBuilderFactory;
private readonly ILogger<HutaoInfrastructureClient> logger;
private readonly RuntimeOptions runtimeOptions;
private readonly HttpClient httpClient;
public async ValueTask<HutaoResponse<StaticResourceSizeInformation>> GetStaticSizeAsync(CancellationToken token = default)
@@ -41,6 +43,7 @@ internal sealed partial class HutaoInfrastructureClient
{
HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create()
.SetRequestUri(HutaoEndpoints.PatchSnapHutao)
.SetHeader("x-device-id", runtimeOptions.DeviceId)
.Get();
HutaoResponse<HutaoVersionInformation>? resp = await builder.TryCatchSendAsync<HutaoResponse<HutaoVersionInformation>>(httpClient, logger, token).ConfigureAwait(false);