XFEExtension.NetCore.ServerInteractive
[DLL] Server interaction extension, including user identity verification and querying in conjunction with AutoConfig
关注
0
Fork
0
Star
0
返回提交历史
Modified
XFEExtension.NetCore.ServerInteractive.TServer/Services/TestCoreService.cs
+2
-2
Modified
XFEExtension.NetCore.ServerInteractive/Utilities/Server/Services/CoreService/UserLoginService.cs
+3
-3
Modified
XFEExtension.NetCore.ServerInteractive/Utilities/Server/Services/CoreService/UserReloginService.cs
+1
-1
XFEstudio/XFEExtension.NetCore.ServerInteractive
完善登录功能底层服务
a7ea5d8
代码差异
3 个文件
+6
-6
@@ -2,9 +2,9 @@
2
2
3
3
namespace XFEExtension.NetCore.ServerInteractive.TServer.Services;
4
4
5
public class TestCoreService : ServerCoreStandardAsyncServiceBase
5
public class TestCoreService : ServerCoreStandardServiceBase
6
6
{
7
public override async Task StandardRequestReceived()
7
public override async Task RequestReceiveAsync()
8
8
{
9
9
Console.Write($"收到方法{Execute}");
10
10
await Close("完成");
@@ -22,7 +22,7 @@ public class UserLoginService<T> : ServerCoreUserLoginServiceBase<T> where T : c
22
22
if (password.IsNullOrWhiteSpace()) Error("登录密码不能为空");
23
23
if (computerInfo.IsNullOrWhiteSpace()) Error("电脑信息不能为空");
24
24
var user = UserHelper.GetUser(Json["account"], Json["password"], GetUserFunction(), ReturnArgs!);
25
Console.WriteLine($"{account}({computerInfo})");
25
Console.Write($"{account}({computerInfo[..10]}...)");
26
26
var userLoginList = GetEncryptedUserLoginModelFunction().Where(userLogin => userLogin.UserLoginModel.ComputerInfo == computerInfo);
27
27
var userLogin = GetEncryptedUserLoginModelFunction().FirstOrDefault(userLogin => userLogin.UserLoginModel.UID == user.ID);
28
28
//for (int i = 0; i < userLoginList.Count(); i++)
@@ -49,7 +49,7 @@ public class UserLoginService<T> : ServerCoreUserLoginServiceBase<T> where T : c
49
49
}
50
50
};
51
51
AddEncryptedUserLoginModelFunction(userLogin);
52
Console.Write($"[DEBUG]用户 {user.UserName} 登录成功,登录到期时间 {userLogin.UserLoginModel.EndDateTime}");
52
Console.Write($"到期时间 {userLogin.UserLoginModel.EndDateTime}");
53
53
await ReturnArgs!.Args.ReplyAndClose(JsonSerializer.Serialize(new
54
54
{
55
55
session = $"{user.ID}|{UserHelper.Encrypt(userLogin.Key, userLogin.UserLoginModel)}",
@@ -62,7 +62,7 @@ public class UserLoginService<T> : ServerCoreUserLoginServiceBase<T> where T : c
62
62
userLogin.UserLoginModel.ComputerInfo = computerInfo;
63
63
userLogin.UserLoginModel.LastIPAddress = ReturnArgs!.Args.ClientIP;
64
64
userLogin.UserLoginModel.EndDateTime = DateTime.Now.AddDays(GetLoginKeepDays());
65
Console.Write($"[DEBUG]用户 {user.UserName} 已登录,登录到期时间:{userLogin.UserLoginModel.EndDateTime}");
65
Console.Write($"到期时间:{userLogin.UserLoginModel.EndDateTime}");
66
66
await Close(JsonSerializer.Serialize(new
67
67
{
68
68
session = $"{user.ID}|{UserHelper.Encrypt(userLogin.Key, userLogin.UserLoginModel)}",
@@ -17,7 +17,7 @@ public class UserReloginService<T> : ServerCoreUserLoginServiceBase<T> where T :
17
17
{
18
18
Console.Write($"校验登录请求:");
19
19
var session = Regex.Unescape(Json["session"].ToString());
20
Console.WriteLine(session);
20
Console.Write(session[..10]);
21
21
var computerInfo = Json["computerInfo"].ToString();
22
22
if (session.IsNullOrWhiteSpace()) Error("Session值不能为空");
23
23
if (computerInfo.IsNullOrWhiteSpace()) Error("电脑信息不能为空");