mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
Compare commits
1 Commits
feat/daily
...
feat/combo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cef1ad3a66 |
@@ -145,6 +145,14 @@ internal sealed partial class UserQRCodeDialog : ContentDialog, IDisposable
|
||||
ArgumentNullException.ThrowIfNull(uidGameToken);
|
||||
return uidGameToken;
|
||||
}
|
||||
|
||||
// only available when game id is 4
|
||||
else if (query is { ReturnCode: 0, Data: { Stat: "Confirmed", Payload.Proto: "Combo" } })
|
||||
{
|
||||
ComboTokenWrapper? comboTokenWrapper = JsonSerializer.Deserialize<ComboTokenWrapper>(query.Data.Payload.Raw);
|
||||
ArgumentNullException.ThrowIfNull(comboTokenWrapper);
|
||||
return UidGameToken.From(comboTokenWrapper);
|
||||
}
|
||||
else if (query.ReturnCode == (int)KnownReturnCode.QrCodeExpired)
|
||||
{
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
namespace Snap.Hutao.Web.Hoyolab.Passport;
|
||||
|
||||
internal sealed class ComboTokenWrapper
|
||||
{
|
||||
[JsonPropertyName("open_id")]
|
||||
public string OpenId { get; set; } = default!;
|
||||
|
||||
[JsonPropertyName("open_token")]
|
||||
public string OpenToken { get; set; } = default!;
|
||||
}
|
||||
@@ -1,14 +1,22 @@
|
||||
// Copyright (c) DGP Studio. All rights reserved.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
using Snap.Hutao.Core.Abstraction;
|
||||
|
||||
namespace Snap.Hutao.Web.Hoyolab.Passport;
|
||||
|
||||
[HighQuality]
|
||||
internal sealed class UidGameToken
|
||||
internal sealed class UidGameToken : IMappingFrom<UidGameToken, ComboTokenWrapper>
|
||||
{
|
||||
[JsonPropertyName("uid")]
|
||||
public string Uid { get; set; } = default!;
|
||||
|
||||
[JsonPropertyName("token")]
|
||||
public string GameToken { get; set; } = default!;
|
||||
|
||||
public static UidGameToken From(ComboTokenWrapper wrapper) => new()
|
||||
{
|
||||
Uid = wrapper.OpenId,
|
||||
GameToken = wrapper.OpenToken,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user