From 3bef606931fff7217dd020b58ef1c319cacd3500 Mon Sep 17 00:00:00 2001 From: Mili Date: Fri, 31 Mar 2023 00:18:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B3=A8=E5=86=8C=E5=90=8E?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E8=87=AA=E5=8A=A8=E7=99=BB=E5=BD=95=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FunGame.Core/Library/SQLScript/Entity/UserQuery.cs | 3 ++- FunGame.Desktop/UI/Login/Login.cs | 6 +----- FunGame.Desktop/UI/Register/Register.cs | 3 ++- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/FunGame.Core/Library/SQLScript/Entity/UserQuery.cs b/FunGame.Core/Library/SQLScript/Entity/UserQuery.cs index 0189c90..68ac83e 100644 --- a/FunGame.Core/Library/SQLScript/Entity/UserQuery.cs +++ b/FunGame.Core/Library/SQLScript/Entity/UserQuery.cs @@ -57,7 +57,8 @@ 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}')"; } } } diff --git a/FunGame.Desktop/UI/Login/Login.cs b/FunGame.Desktop/UI/Login/Login.cs index 047f503..b3a30af 100644 --- a/FunGame.Desktop/UI/Login/Login.cs +++ b/FunGame.Desktop/UI/Login/Login.cs @@ -74,6 +74,7 @@ namespace Milimoe.FunGame.Desktop.UI { GoToLogin.Enabled = false; if (await Login_Handler() == false) GoToLogin.Enabled = true; + else Dispose(); } private void ForgetPassword_Click(object sender, EventArgs e) @@ -91,11 +92,6 @@ namespace Milimoe.FunGame.Desktop.UI private EventResult SucceedLoginEvent(object sender, LoginEventArgs e) { - if (!IsDisposed) - { - if (InvokeRequired) Invoke(Close); - else Close(); - } RunTime.Main?.OnSucceedLoginEvent(e); return EventResult.Success; } diff --git a/FunGame.Desktop/UI/Register/Register.cs b/FunGame.Desktop/UI/Register/Register.cs index 5c02908..ae30181 100644 --- a/FunGame.Desktop/UI/Register/Register.cs +++ b/FunGame.Desktop/UI/Register/Register.cs @@ -120,7 +120,8 @@ namespace Milimoe.FunGame.Desktop.UI { string username = ((RegisterEventArgs)e).Username; string password = ((RegisterEventArgs)e).Password; - RunTime.Connector?.AutoLogin(username, password); + _ = LoginController.LoginAccount(username, password); + RunTime.Login?.Close(); return EventResult.Success; }