Skip to content

Commit

Permalink
磁盘序列号可能包括TF卡和U盘,为了避免A2烧写过程中忘了拔掉U盘,修改为任意磁盘序列号匹配则通过
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Aug 4, 2024
1 parent 743821c commit 070fe82
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions Stardust.Server/Services/NodeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,11 @@ private static Node CheckNode(Node node, NodeInfo di, String productCode, String
node.WriteHistory("登录校验", false, $"主板不符!(新!=旧){board}!={node.Board}", ip);
//flag = false;
}
if (!diskid.IsNullOrEmpty() && diskid != node.DiskID)
{
node.WriteHistory("登录校验", false, $"磁盘序列号不符!(新!=旧){diskid}!={node.DiskID}", ip);
level--;
}
//if (!diskid.IsNullOrEmpty() && diskid != node.DiskID)
//{
// node.WriteHistory("登录校验", false, $"磁盘序列号不符!(新!=旧){diskid}!={node.DiskID}", ip);
// level--;
//}
if (!node.ProductCode.IsNullOrEmpty() && !productCode.IsNullOrEmpty() && !node.ProductCode.EqualIgnoreCase(productCode))
{
node.WriteHistory("登录校验", false, $"产品编码不符!(新!=旧){productCode}!={node.ProductCode}", ip);
Expand All @@ -202,14 +202,27 @@ private static Node CheckNode(Node node, NodeInfo di, String productCode, String
{
var dims = di.Macs?.Split(",") ?? [];
var nodems = node.MACs?.Split(",") ?? [];
// 任意网卡匹配则通过
// 任意匹配则通过
if (!nodems.Any(e => dims.Contains(e)))
{
node.WriteHistory("登录校验", false, $"网卡地址不符!(新!=旧){di.Macs}!={node.MACs}", ip);
level--;
}
}

// 磁盘。可能有TF卡和U盘
if (diskid != node.DiskID)
{
var dims = diskid?.Split(",") ?? [];
var nodems = node.DiskID?.Split(",") ?? [];
// 任意匹配则通过
if (!nodems.Any(e => dims.Contains(e)))
{
node.WriteHistory("登录校验", false, $"磁盘序列号不符!(新!=旧){diskid}!={node.DiskID}", ip);
level--;
}
}

if (level < minLevel) return null;

return node;
Expand Down

0 comments on commit 070fe82

Please sign in to comment.