From 09862b47fc89f2dc6b60fb961c71bd8f058dab5b Mon Sep 17 00:00:00 2001 From: milimoe Date: Tue, 12 Sep 2023 23:55:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E5=90=8E=E6=B2=A1=E6=9C=89=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FunGame.Desktop/Controller/LoginController.cs | 4 ++-- FunGame.Desktop/Controller/RegisterController.cs | 2 +- FunGame.Desktop/UI/Register/Register.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/FunGame.Desktop/Controller/LoginController.cs b/FunGame.Desktop/Controller/LoginController.cs index 4645aa2..1c935e0 100644 --- a/FunGame.Desktop/Controller/LoginController.cs +++ b/FunGame.Desktop/Controller/LoginController.cs @@ -22,14 +22,14 @@ namespace Milimoe.FunGame.Desktop.Controller UIForm = form; } - public async Task LoginAccountAsync(string username, string password, string autokey = "") + public async Task LoginAccountAsync(string username, string password, string autokey = "", bool encrypt = true) { bool result = false; string msg = ""; try { - password = password.Encrypt(username); + if (encrypt) password = password.Encrypt(username); LoginEventArgs args = new(username, password, autokey); if (OnBeforeLoginEvent(args)) diff --git a/FunGame.Desktop/Controller/RegisterController.cs b/FunGame.Desktop/Controller/RegisterController.cs index db493c1..64d4bd0 100644 --- a/FunGame.Desktop/Controller/RegisterController.cs +++ b/FunGame.Desktop/Controller/RegisterController.cs @@ -41,7 +41,7 @@ namespace Milimoe.FunGame.Desktop.Controller { case RegInvokeType.InputVerifyCode: { - while (true) + while (!result) { string verifycode = ShowMessage.InputMessageCancel("请输入注册邮件中的6位数字验证码", "注册验证码", out MessageResult cancel); if (cancel != MessageResult.Cancel) diff --git a/FunGame.Desktop/UI/Register/Register.cs b/FunGame.Desktop/UI/Register/Register.cs index 175beb7..30513c8 100644 --- a/FunGame.Desktop/UI/Register/Register.cs +++ b/FunGame.Desktop/UI/Register/Register.cs @@ -116,7 +116,7 @@ namespace Milimoe.FunGame.Desktop.UI { string username = ((RegisterEventArgs)e).Username; string password = ((RegisterEventArgs)e).Password; - TaskUtility.StartAndAwaitTask(async () => await LoginController.LoginAccountAsync(username, password)); + TaskUtility.StartAndAwaitTask(async () => await LoginController.LoginAccountAsync(username, password, encrypt: false)); RunTime.Login?.Close(); return EventResult.Success; }