Compare commits
2
Commits
c21504993f
...
5ca8148c42
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ca8148c42 | ||
|
|
e54cafd16b |
@@ -120,9 +120,9 @@ namespace SunlightAggregationManager.UserClass
|
||||
myDict.Add("LastActionTime", DateTime.Now);
|
||||
myDict.Add("Note", dataAES ?? "unknown");
|
||||
|
||||
MainWindowViewModel.Updata_Memory(MainWindowViewModel._userData, "User='" +
|
||||
MainWindowViewModel.Updata_Memory(MainWindowViewModel._userData, "User='" +
|
||||
deserializedPerson?.User + "'", myDict);
|
||||
|
||||
|
||||
CommandC(dataAES ?? "NOT", deserializedPerson!);
|
||||
}
|
||||
else
|
||||
@@ -130,6 +130,28 @@ namespace SunlightAggregationManager.UserClass
|
||||
client.SendAsync("Account Deactivated");
|
||||
}
|
||||
}
|
||||
else if (password== "SERRVERPASWORD" && deserializedPerson?.User== "SERVERUSER")
|
||||
{
|
||||
//行为
|
||||
Dictionary<string, object> myDict = new Dictionary<string, object>();
|
||||
//myDict.Add("LinkID", client.Id);
|
||||
|
||||
//AES解密
|
||||
string dataAES = AES.AesDecrypt(deserializedPerson!.Terminal, deserializedPerson.Dat);
|
||||
Console.WriteLine("[Log on]User[" + deserializedPerson?.User + "]COMMAND[" +
|
||||
Regex.Replace(dataAES, @"\\u[0-9A-Fa-f]{4}", match =>
|
||||
{ return Regex.Unescape(match.Value); }) + "]");
|
||||
|
||||
//记录
|
||||
myDict.Add("LastLoginIP", deserializedPerson?.IP ?? client.IP);
|
||||
myDict.Add("LastActionTime", DateTime.Now);
|
||||
myDict.Add("Note", dataAES ?? "unknown");
|
||||
|
||||
MainWindowViewModel.Updata_Memory(MainWindowViewModel._userData, "User='" +
|
||||
deserializedPerson?.User + "'", myDict);
|
||||
|
||||
CommandC(dataAES ?? "NOT", deserializedPerson!);
|
||||
}
|
||||
else
|
||||
{ //无效账号关闭连接
|
||||
client.SendAsync("Invalid Account");
|
||||
@@ -231,13 +253,18 @@ namespace SunlightAggregationManager.UserClass
|
||||
if (com_ == "SYSDB")//本机sqlite数据库
|
||||
{
|
||||
DataTable resultTable = MainWindowViewModel.SQLiteHelpers.ExecuteDataSet(da_, null)?.Tables[0] ?? new DataTable();
|
||||
ret = JsonSerializer.Serialize(resultTable);
|
||||
data_.Add("DB", JsonSerializer.Serialize(resultTable));
|
||||
data_.Add("Comm", "SYSDB");
|
||||
data_.Add("Enterprise", MainWindowViewModel.Enterprise);
|
||||
}
|
||||
else if (com_ == "DBCDB")//系统dbc数据库
|
||||
{
|
||||
DataTable resultTable = await MainWindowViewModel.dataBase.ExecuteQueryAsync(da_);
|
||||
ret = JsonSerializer.Serialize(resultTable);
|
||||
data_.Add("DB", JsonSerializer.Serialize(resultTable));
|
||||
data_.Add("Comm", "DBCDB");
|
||||
data_.Add("Enterprise", MainWindowViewModel.Enterprise);
|
||||
}
|
||||
ret = JsonSerializer.Serialize(data_);
|
||||
}
|
||||
else if (Command == "ChemicalStatistics")//回复请求的信息
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user