You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.0 KiB
C#
42 lines
1.0 KiB
C#
|
|
using System.Text.Json;
|
|
using OMS.NET.Common;
|
|
|
|
namespace OMS.NET.Instructs
|
|
{
|
|
/// <summary>
|
|
/// 登录指令
|
|
/// </summary>
|
|
public class LoginInstruct : Instruct
|
|
{
|
|
public LoginInstruct()
|
|
{
|
|
Type = "login";
|
|
}
|
|
|
|
public override Task Handler(string wsid)
|
|
{
|
|
return Task.Run(() =>
|
|
{
|
|
if (Data?.GetType() == typeof(JsonElement))
|
|
{
|
|
string email = Data.GetProperty("email").GetString();
|
|
string password = Data.GetProperty("password").GetString();
|
|
if (string.IsNullOrEmpty(email) || string.IsNullOrEmpty(password))
|
|
{
|
|
Log.Warn("登录信息不能为空!");
|
|
return;
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
public class LoginStatusInstuct : Instruct
|
|
{
|
|
public LoginStatusInstuct()
|
|
{
|
|
Type = "loginStatus";
|
|
}
|
|
}
|
|
} |