-
-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
welcome back qr login #2060
Merged
welcome back qr login #2060
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 QrLogin | ||
{ | ||
[JsonPropertyName("url")] | ||
public string Url { get; set; } = default!; | ||
|
||
[JsonPropertyName("ticket")] | ||
public string Ticket { get; set; } = default!; | ||
} |
40 changes: 40 additions & 0 deletions
40
src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Passport/QrLoginResult.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright (c) DGP Studio. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
namespace Snap.Hutao.Web.Hoyolab.Passport; | ||
|
||
internal sealed class QrLoginResult | ||
{ | ||
[JsonPropertyName("status")] | ||
public string Status { get; set; } = default!; | ||
|
||
[JsonPropertyName("app_id")] | ||
public string AppId { get; set; } = default!; | ||
|
||
[JsonPropertyName("client_type")] | ||
public int ClientType { get; set; } | ||
|
||
[JsonPropertyName("created_at")] | ||
public string CreatedAt { get; set; } = default!; | ||
|
||
[JsonPropertyName("scanned_at")] | ||
public string ScannedAt { get; set; } = default!; | ||
|
||
[JsonPropertyName("tokens")] | ||
public List<TokenWrapper> Tokens { get; set; } = default!; | ||
|
||
[JsonPropertyName("user_info")] | ||
public UserInformation UserInfo { get; set; } = default!; | ||
|
||
[JsonPropertyName("realname_info")] | ||
public RealnameInfo RealnameInfo { get; set; } = default!; | ||
|
||
[JsonPropertyName("need_realperson")] | ||
public bool NeedRealperson { get; set; } | ||
|
||
[JsonPropertyName("ext")] | ||
public string Ext { get; set; } = default!; | ||
|
||
[JsonPropertyName("scan_game_biz")] | ||
public string ScanGameBiz { get; set; } = default!; | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Passport/QrTicketWrapper.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Copyright (c) DGP Studio. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
namespace Snap.Hutao.Web.Hoyolab.Passport; | ||
|
||
internal sealed class QrTicketWrapper | ||
{ | ||
[JsonPropertyName("ticket")] | ||
public string Ticket { get; set; } = default!; | ||
} |
16 changes: 16 additions & 0 deletions
16
src/Snap.Hutao/Snap.Hutao/Web/Hoyolab/Passport/RealnameInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (c) DGP Studio. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
namespace Snap.Hutao.Web.Hoyolab.Passport; | ||
|
||
internal sealed class RealnameInfo | ||
{ | ||
[JsonPropertyName("required")] | ||
public bool Required { get; set; } | ||
|
||
[JsonPropertyName("action_type")] | ||
public string ActionType { get; set; } = default!; | ||
|
||
[JsonPropertyName("action_ticket")] | ||
public string ActionTicket { get; set; } = default!; | ||
} |
6 changes: 6 additions & 0 deletions
6
src/Snap.Hutao/Snap.Hutao/Web/Request/Builder/EmptyContent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Copyright (c) DGP Studio. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
namespace Snap.Hutao.Web.Request.Builder; | ||
|
||
internal readonly struct EmptyContent; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using Single to get the token might throw an exception if there are multiple tokens of type 1. Ensure there is exactly one token of type 1 or handle multiple tokens gracefully.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.