Commit 2605dc7b authored by zhanglongtao's avatar zhanglongtao

update

parent 647a7a47
......@@ -36,4 +36,14 @@ namespace HYH.Registry.Services.Encryption
/// </summary>
public string TenantCode { get; set; }
}
/// <summary>
/// 登录验证dto
/// </summary>
public class LoginVerifyCiphertextDto
{
/// <summary>
/// 租户号
/// </summary>
public string TenantCode { get; set; }
}
}
......@@ -41,6 +41,7 @@ namespace HYH.Registry.Services.Encryption
/// 获取Mac地址
/// </summary>
/// <returns></returns>
[AllowAnonymous]
[HttpGet]
public string GetMACAddress()
{
......@@ -100,21 +101,22 @@ namespace HYH.Registry.Services.Encryption
/// 登录的密文验证
/// </summary>
/// <returns></returns>
public async Task<IActionResult> LoginCipherCertification()
[AllowAnonymous]
[HttpPost]
public async Task<IActionResult> LoginCipherCertification(LoginVerifyCiphertextDto input)
{
bool flag = false;
try
{
string netCardMACAddress = ComputerInfoHelper.GetMACAddress();
var tenant = await _repTenant.FirstOrDefaultAsync(q => q.Code == _currentUser.TenantCode);
var tenant = await _repTenant.FirstOrDefaultAsync(q => q.Code == input.TenantCode);
if (!string.IsNullOrEmpty(tenant.RegistryCipher))
{
// 解密
var dataString = AESHelper.AESDecrypt(tenant.RegistryCipher, "jianzhukeji", "jzkj");
string timeStr = dataString.Substring(0, 19);
DateTime dateTime = Convert.ToDateTime(timeStr);
if (dateTime > DateTime.Now)
if (dateTime > DateTime.Now && !string.IsNullOrEmpty(netCardMACAddress) && dataString.Contains(netCardMACAddress))
{
flag = true;
}
......@@ -133,6 +135,7 @@ namespace HYH.Registry.Services.Encryption
/// 获取Mac地址
/// </summary>
/// <returns></returns>
[AllowAnonymous]
[HttpGet]
public string GetNetCardMACAddress()
{
......@@ -143,6 +146,7 @@ namespace HYH.Registry.Services.Encryption
/// 获取所有Mac地址
/// </summary>
/// <returns></returns>
[AllowAnonymous]
[HttpGet]
public string PrintAllMacAddress()
{
......@@ -153,6 +157,7 @@ namespace HYH.Registry.Services.Encryption
/// 获取第一个mac地址
/// </summary>
/// <returns></returns>
[AllowAnonymous]
[HttpGet]
public string GetFirstMacAddress()
{
......@@ -163,6 +168,7 @@ namespace HYH.Registry.Services.Encryption
/// 获取Mac地址
/// </summary>
/// <returns></returns>
[AllowAnonymous]
[HttpGet]
public string GetMACIp()
{
......@@ -173,6 +179,7 @@ namespace HYH.Registry.Services.Encryption
/// 获取电脑名称
/// </summary>
/// <returns></returns>
[AllowAnonymous]
[HttpGet]
public string GetName()
{
......@@ -183,6 +190,7 @@ namespace HYH.Registry.Services.Encryption
/// 获取硬盘序列号
/// </summary>
/// <returns></returns>
[AllowAnonymous]
[HttpGet]
public string GetHardDiskSerialNumber()
{
......@@ -190,15 +198,15 @@ namespace HYH.Registry.Services.Encryption
return hardDiskSerialNumber;
}
/// <summary>
/// 获取内网ip
/// </summary>
/// <returns></returns>
public async Task<object> GetInternalIP()
{
var InternalIP = ComputerInfoHelper.GetInternalIP();
return InternalIP.ToString();
}
///// <summary>
///// 获取内网ip
///// </summary>
///// <returns></returns>
//public async Task<object> GetInternalIP()
//{
// var InternalIP = ComputerInfoHelper.GetInternalIP();
// return InternalIP.ToString();
//}
}
}
......@@ -101,6 +101,16 @@
租户号
</summary>
</member>
<member name="T:HYH.Registry.Services.Encryption.LoginVerifyCiphertextDto">
<summary>
登录验证dto
</summary>
</member>
<member name="P:HYH.Registry.Services.Encryption.LoginVerifyCiphertextDto.TenantCode">
<summary>
租户号
</summary>
</member>
<member name="T:HYH.Registry.Services.Encryption.EncryptionService">
<summary>
......@@ -136,7 +146,7 @@
<param name="input"></param>
<returns></returns>
</member>
<member name="M:HYH.Registry.Services.Encryption.EncryptionService.LoginCipherCertification">
<member name="M:HYH.Registry.Services.Encryption.EncryptionService.LoginCipherCertification(HYH.Registry.Services.Encryption.LoginVerifyCiphertextDto)">
<summary>
登录的密文验证
</summary>
......@@ -178,11 +188,5 @@
</summary>
<returns></returns>
</member>
<member name="M:HYH.Registry.Services.Encryption.EncryptionService.GetInternalIP">
<summary>
获取内网ip
</summary>
<returns></returns>
</member>
</members>
</doc>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment