forked from project-redbud/FunGame-Core
66 lines
2.0 KiB
C#
66 lines
2.0 KiB
C#
using Milimoe.FunGame.Core.Api.Utility;
|
|
using Milimoe.FunGame.Core.Library.Exception;
|
|
using Milimoe.FunGame.Desktop.Controller;
|
|
using Milimoe.FunGame.Desktop.Library;
|
|
using Milimoe.FunGame.Desktop.Library.Base;
|
|
using Milimoe.FunGame.Desktop.Library.Component;
|
|
using Milimoe.FunGame.Desktop.Utility;
|
|
|
|
namespace Milimoe.FunGame.Desktop.UI
|
|
{
|
|
public partial class Login : BaseLogin
|
|
{
|
|
public Login()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void Login_Handler()
|
|
{
|
|
try
|
|
{
|
|
string username = UsernameText.Text.Trim();
|
|
string password = PasswordText.Text.Trim();
|
|
if (username == "" || password == "")
|
|
{
|
|
ShowMessage.ErrorMessage("账号或密码不能为空!");
|
|
UsernameText.Focus();
|
|
return;
|
|
}
|
|
password = password.Encrypt(username);
|
|
if (!LoginController.LoginAccount(username, password))
|
|
ShowMessage.Message("登录失败!!", "登录失败");
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
RunTime.WritelnSystemInfo(e.GetErrorInfo());
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 打开注册界面
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
private void RegButton_Click(object sender, EventArgs e)
|
|
{
|
|
OpenForm.SingleForm(Core.Library.Constant.FormType.Register, Core.Library.Constant.OpenFormType.Dialog);
|
|
}
|
|
|
|
private void FastLogin_Click(object sender, EventArgs e)
|
|
{
|
|
ShowMessage.TipMessage("与No.16对话即可获得快速登录秘钥,快去试试吧!");
|
|
}
|
|
|
|
private void GoToLogin_Click(object sender, EventArgs e)
|
|
{
|
|
Login_Handler();
|
|
}
|
|
|
|
private void ForgetPassword_Click(object sender, EventArgs e)
|
|
{
|
|
ShowMessage.TipMessage("暂不支持找回密码~");
|
|
}
|
|
}
|
|
}
|