diff --git a/Stardust.Server/Services/NodeService.cs b/Stardust.Server/Services/NodeService.cs index e7b810d7..8d91ec0d 100644 --- a/Stardust.Server/Services/NodeService.cs +++ b/Stardust.Server/Services/NodeService.cs @@ -7,6 +7,7 @@ using NewLife.Security; using NewLife.Serialization; using NewLife.Web; +using Stardust.Data; using Stardust.Data.Nodes; using Stardust.Data.Platform; using Stardust.Models; @@ -43,8 +44,9 @@ public Boolean Auth(Node node, String secret, LoginInfo inf, String ip, StarServ } if (node.Secret.IsNullOrEmpty()) return true; + if (node.Secret == secret) return true; //return !secret.IsNullOrEmpty() && !secret.IsNullOrEmpty() && (node.Secret == secret || node.Secret.MD5() == secret); - if (!_passwordProvider.Verify(node.Secret, secret)) + if (secret.IsNullOrEmpty() || !_passwordProvider.Verify(node.Secret, secret)) { WriteHistory(node, "节点鉴权", false, "密钥校验失败", ip); return false; diff --git a/Stardust.Server/Services/RegistryService.cs b/Stardust.Server/Services/RegistryService.cs index 035355c5..bb475658 100644 --- a/Stardust.Server/Services/RegistryService.cs +++ b/Stardust.Server/Services/RegistryService.cs @@ -52,7 +52,8 @@ public Boolean Auth(App app, String secret, String ip, String clientId) // 未设置密钥,直接通过 if (app.Secret.IsNullOrEmpty()) return true; - if (!_passwordProvider.Verify(app.Secret, secret)) + if (app.Secret == secret) return true; + if (secret.IsNullOrEmpty() || !_passwordProvider.Verify(app.Secret, secret)) { app.WriteHistory("应用鉴权", false, "密钥校验失败", null, ip, clientId); return false;