Merge branch 'master' of http://www.scserverddns.top:13000/sc/SunlightAggregationManager
This commit is contained in:
commit
4f1025e247
2 files changed
+37
-10
No files matched your search
@@ -1,11 +1,13 @@
|
||||
using System;
|
||||
using SunlightAggregationManager.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json;
|
||||
using System.Data;
|
||||
using System.Security.Cryptography.Pkcs;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Xml.Linq;
|
||||
using TouchSocket.Core;
|
||||
using TouchSocket.Sockets;
|
||||
using SunlightAggregationManager.ViewModel;
|
||||
using System.Security.Cryptography.Pkcs;
|
||||
|
||||
namespace SunlightAggregationManager.UserClass
|
||||
{
|
||||
@@ -77,6 +79,19 @@ namespace SunlightAggregationManager.UserClass
|
||||
|
||||
Console.WriteLine("[Log on]User[" + deserializedPerson?.User + "]IP[" + deserializedPerson?.IP ?? client.IP +
|
||||
"]ID[" + client.Id + "]Terminal[" + (deserializedPerson?.Terminal ?? "unknown device") + "]");
|
||||
|
||||
//返回登录信息
|
||||
Dictionary<string, object> login = new Dictionary<string, object>();
|
||||
DataRow? dat = MainWindowViewModel.Selet_Row(MainWindowViewModel._userData,"User='" +
|
||||
deserializedPerson?.User + "' and Password ='" + deserializedPerson?.Password + "'");
|
||||
login.Add("Enterprise", dat?.Field<object>("Enterprise")??"");
|
||||
login.Add("Department", dat?.Field<object>("Department") ?? "");
|
||||
login.Add("Groups", dat?.Field<object>("Groups") ?? "");
|
||||
login.Add("UserId", dat?.Field<object>("UserID") ?? "");
|
||||
login.Add("UserName", dat?.Field<object>("Name") ?? "");
|
||||
|
||||
var d = JsonSerializer.Serialize(login);
|
||||
client.SendAsync(d);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -63,10 +63,6 @@ namespace SunlightAggregationManager.ViewModel
|
||||
ActionLog = (SQLiteHelpers.ExecuteDataSet("select * from ActionLog", null)?.Tables[0] ?? new DataTable()).Clone();
|
||||
// SQLiteHelpers.Close();
|
||||
|
||||
if (UserData.Columns.Contains("UserID"))
|
||||
{
|
||||
UserData.Columns.Remove("UserID");
|
||||
}
|
||||
DataRow[] dataRows = UserData.Select("State<90");
|
||||
foreach (DataRow row in dataRows)
|
||||
{
|
||||
@@ -160,20 +156,36 @@ namespace SunlightAggregationManager.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
public static DataRow? Selet_Row(DataTable DB, string? key)//查询
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (DB)
|
||||
{
|
||||
DataRow drEmployee = DB.Select(key).First();
|
||||
return drEmployee;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Selet_Row:" + ex.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public static object? Selet_Memory(DataTable DB, string name, string? key)//查询
|
||||
{
|
||||
try
|
||||
{
|
||||
lock (DB)
|
||||
{
|
||||
var drEmployee = DB.Select(key).First();
|
||||
DataRow drEmployee = DB.Select(key).First();
|
||||
object? index = drEmployee.Field<object>(name);
|
||||
return index;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("SDTD:" + ex.ToString());
|
||||
Console.WriteLine("Selet_Memory:" + ex.ToString());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user