mirror of
https://github.com/project-redbud/FunGame-Desktop.git
synced 2025-04-21 20:49:34 +08:00
修复:注册成功后没有自动登录
This commit is contained in:
parent
7061996177
commit
09862b47fc
@ -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))
|
||||||
|
@ -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)
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user