forked from project-redbud/FunGame-Core
修复注册后不能自动登录的问题
This commit is contained in:
parent
15ed5152de
commit
3bef606931
@ -57,7 +57,8 @@
|
|||||||
|
|
||||||
public static string Insert_Register(string Username, string Password, string Email)
|
public static string Insert_Register(string Username, string Password, string Email)
|
||||||
{
|
{
|
||||||
return $"{Constant.Command_Insert} {Constant.Command_Into} {TableName} ({Column_Username}, {Column_Password}, {Column_Email}, {Column_RegTime}) {Constant.Command_Values} ('{Username}', '{Password}', '{Email}', '{DateTime.Now}')";
|
DateTime Now = DateTime.Now;
|
||||||
|
return $"{Constant.Command_Insert} {Constant.Command_Into} {TableName} ({Column_Username}, {Column_Password}, {Column_Email}, {Column_RegTime}, {Column_LastTime}) {Constant.Command_Values} ('{Username}', '{Password}', '{Email}', '{Now}', '{Now}')";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -74,6 +74,7 @@ namespace Milimoe.FunGame.Desktop.UI
|
|||||||
{
|
{
|
||||||
GoToLogin.Enabled = false;
|
GoToLogin.Enabled = false;
|
||||||
if (await Login_Handler() == false) GoToLogin.Enabled = true;
|
if (await Login_Handler() == false) GoToLogin.Enabled = true;
|
||||||
|
else Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ForgetPassword_Click(object sender, EventArgs e)
|
private void ForgetPassword_Click(object sender, EventArgs e)
|
||||||
@ -91,11 +92,6 @@ namespace Milimoe.FunGame.Desktop.UI
|
|||||||
|
|
||||||
private EventResult SucceedLoginEvent(object sender, LoginEventArgs e)
|
private EventResult SucceedLoginEvent(object sender, LoginEventArgs e)
|
||||||
{
|
{
|
||||||
if (!IsDisposed)
|
|
||||||
{
|
|
||||||
if (InvokeRequired) Invoke(Close);
|
|
||||||
else Close();
|
|
||||||
}
|
|
||||||
RunTime.Main?.OnSucceedLoginEvent(e);
|
RunTime.Main?.OnSucceedLoginEvent(e);
|
||||||
return EventResult.Success;
|
return EventResult.Success;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -120,7 +120,8 @@ 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;
|
||||||
RunTime.Connector?.AutoLogin(username, password);
|
_ = LoginController.LoginAccount(username, password);
|
||||||
|
RunTime.Login?.Close();
|
||||||
return EventResult.Success;
|
return EventResult.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user