Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
HYH.Registry
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张龙涛
HYH.Registry
Commits
2605dc7b
Commit
2605dc7b
authored
Aug 24, 2021
by
zhanglongtao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
647a7a47
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
20 deletions
+42
-20
EncryptionDto.cs
...Registry.Application/Services/Encryption/EncryptionDto.cs
+10
-0
EncryptionService.cs
...stry.Application/Services/Encryption/EncryptionService.cs
+21
-13
HYH.Registry.Application.xml
src/HYH.Registry.Web.Host/HYH.Registry.Application.xml
+11
-7
No files found.
src/HYH.Registry.Application/Services/Encryption/EncryptionDto.cs
View file @
2605dc7b
...
...
@@ -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
;
}
}
}
src/HYH.Registry.Application/Services/Encryption/EncryptionService.cs
View file @
2605dc7b
...
...
@@ -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();
//
}
}
}
src/HYH.Registry.Web.Host/HYH.Registry.Application.xml
View file @
2605dc7b
...
...
@@ -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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment