mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
complete cancel registration
This commit is contained in:
@@ -26,12 +26,12 @@ internal sealed partial class HutaoPassportUnregisterDialog : ContentDialog
|
||||
infoBarService = serviceProvider.GetRequiredService<IInfoBarService>();
|
||||
}
|
||||
|
||||
public async ValueTask<ValueResult<bool, (string UserName, string Passport)>> GetInputAsync()
|
||||
public async ValueTask<ValueResult<bool, (string UserName, string Passport, string VerifyCode)>> GetInputAsync()
|
||||
{
|
||||
await taskContext.SwitchToMainThreadAsync();
|
||||
ContentDialogResult result = await ShowAsync();
|
||||
|
||||
return new(result is ContentDialogResult.Primary, (UserName, Password));
|
||||
return new(result is ContentDialogResult.Primary, (UserName, Password, VerifyCode));
|
||||
}
|
||||
|
||||
[Command("VerifyCommand")]
|
||||
|
||||
@@ -67,18 +67,18 @@ internal sealed partial class HutaoPassportViewModel : Abstraction.ViewModel
|
||||
private async Task UnregisterAsync()
|
||||
{
|
||||
HutaoPassportUnregisterDialog dialog = await contentDialogFactory.CreateInstanceAsync<HutaoPassportUnregisterDialog>().ConfigureAwait(false);
|
||||
ValueResult<bool, (string UserName, string Password)> result = await dialog.GetInputAsync().ConfigureAwait(false);
|
||||
ValueResult<bool, (string UserName, string Password, string VerifyCode)> result = await dialog.GetInputAsync().ConfigureAwait(false);
|
||||
|
||||
if (result.IsOk)
|
||||
{
|
||||
(string username, string password) = result.Value;
|
||||
(string username, string password, string verifyCode) = result.Value;
|
||||
|
||||
if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
|
||||
if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(verifyCode))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
HutaoResponse response = await homaPassportClient.UnregisterAsync(username, password).ConfigureAwait(false);
|
||||
HutaoResponse response = await homaPassportClient.UnregisterAsync(username, password, verifyCode).ConfigureAwait(false);
|
||||
|
||||
if (response.IsOk())
|
||||
{
|
||||
|
||||
@@ -96,12 +96,13 @@ internal sealed partial class HomaPassportClient
|
||||
return HutaoResponse.DefaultIfNull(resp);
|
||||
}
|
||||
|
||||
public async ValueTask<HutaoResponse> UnregisterAsync(string email, string password, CancellationToken token = default)
|
||||
public async ValueTask<HutaoResponse> UnregisterAsync(string email, string password, string verifyCode, CancellationToken token = default)
|
||||
{
|
||||
Dictionary<string, string> data = new()
|
||||
{
|
||||
["UserName"] = Encrypt(email),
|
||||
["Password"] = Encrypt(password),
|
||||
["VerifyCode"] = Encrypt(verifyCode),
|
||||
};
|
||||
|
||||
HttpRequestMessageBuilder builder = httpRequestMessageBuilderFactory.Create()
|
||||
|
||||
Reference in New Issue
Block a user