修复:注册成功后没有自动登录

This commit is contained in:
milimoe 2023-09-12 23:55:05 +08:00
parent 7061996177
commit 09862b47fc
Signed by: milimoe
GPG Key ID: 05D280912DA6C69E
3 changed files with 4 additions and 4 deletions

View File

@ -22,14 +22,14 @@ namespace Milimoe.FunGame.Desktop.Controller
UIForm = form; UIForm = form;
} }
public async Task<bool> LoginAccountAsync(string username, string password, string autokey = "") public async Task<bool> LoginAccountAsync(string username, string password, string autokey = "", bool encrypt = true)
{ {
bool result = false; bool result = false;
string msg = ""; string msg = "";
try try
{ {
password = password.Encrypt(username); if (encrypt) password = password.Encrypt(username);
LoginEventArgs args = new(username, password, autokey); LoginEventArgs args = new(username, password, autokey);
if (OnBeforeLoginEvent(args)) if (OnBeforeLoginEvent(args))

View File

@ -41,7 +41,7 @@ namespace Milimoe.FunGame.Desktop.Controller
{ {
case RegInvokeType.InputVerifyCode: case RegInvokeType.InputVerifyCode:
{ {
while (true) while (!result)
{ {
string verifycode = ShowMessage.InputMessageCancel("请输入注册邮件中的6位数字验证码", "注册验证码", out MessageResult cancel); string verifycode = ShowMessage.InputMessageCancel("请输入注册邮件中的6位数字验证码", "注册验证码", out MessageResult cancel);
if (cancel != MessageResult.Cancel) if (cancel != MessageResult.Cancel)

View File

@ -116,7 +116,7 @@ namespace Milimoe.FunGame.Desktop.UI
{ {
string username = ((RegisterEventArgs)e).Username; string username = ((RegisterEventArgs)e).Username;
string password = ((RegisterEventArgs)e).Password; 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(); RunTime.Login?.Close();
return EventResult.Success; return EventResult.Success;
} }