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
Show 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
...
@@ -36,4 +36,14 @@ namespace HYH.Registry.Services.Encryption
/// </summary>
/// </summary>
public
string
TenantCode
{
get
;
set
;
}
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
...
@@ -41,6 +41,7 @@ namespace HYH.Registry.Services.Encryption
/// 获取Mac地址
/// 获取Mac地址
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
AllowAnonymous
]
[
HttpGet
]
[
HttpGet
]
public
string
GetMACAddress
()
public
string
GetMACAddress
()
{
{
...
@@ -100,21 +101,22 @@ namespace HYH.Registry.Services.Encryption
...
@@ -100,21 +101,22 @@ namespace HYH.Registry.Services.Encryption
/// 登录的密文验证
/// 登录的密文验证
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
AllowAnonymous
]
public
async
Task
<
IActionResult
>
LoginCipherCertification
()
[
HttpPost
]
public
async
Task
<
IActionResult
>
LoginCipherCertification
(
LoginVerifyCiphertextDto
input
)
{
{
bool
flag
=
false
;
bool
flag
=
false
;
try
try
{
{
string
netCardMACAddress
=
ComputerInfoHelper
.
GetMACAddress
();
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
))
if
(!
string
.
IsNullOrEmpty
(
tenant
.
RegistryCipher
))
{
{
// 解密
// 解密
var
dataString
=
AESHelper
.
AESDecrypt
(
tenant
.
RegistryCipher
,
"jianzhukeji"
,
"jzkj"
);
var
dataString
=
AESHelper
.
AESDecrypt
(
tenant
.
RegistryCipher
,
"jianzhukeji"
,
"jzkj"
);
string
timeStr
=
dataString
.
Substring
(
0
,
19
);
string
timeStr
=
dataString
.
Substring
(
0
,
19
);
DateTime
dateTime
=
Convert
.
ToDateTime
(
timeStr
);
DateTime
dateTime
=
Convert
.
ToDateTime
(
timeStr
);
if
(
dateTime
>
DateTime
.
Now
)
if
(
dateTime
>
DateTime
.
Now
&&
!
string
.
IsNullOrEmpty
(
netCardMACAddress
)
&&
dataString
.
Contains
(
netCardMACAddress
)
)
{
{
flag
=
true
;
flag
=
true
;
}
}
...
@@ -133,6 +135,7 @@ namespace HYH.Registry.Services.Encryption
...
@@ -133,6 +135,7 @@ namespace HYH.Registry.Services.Encryption
/// 获取Mac地址
/// 获取Mac地址
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
AllowAnonymous
]
[
HttpGet
]
[
HttpGet
]
public
string
GetNetCardMACAddress
()
public
string
GetNetCardMACAddress
()
{
{
...
@@ -143,6 +146,7 @@ namespace HYH.Registry.Services.Encryption
...
@@ -143,6 +146,7 @@ namespace HYH.Registry.Services.Encryption
/// 获取所有Mac地址
/// 获取所有Mac地址
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
AllowAnonymous
]
[
HttpGet
]
[
HttpGet
]
public
string
PrintAllMacAddress
()
public
string
PrintAllMacAddress
()
{
{
...
@@ -153,6 +157,7 @@ namespace HYH.Registry.Services.Encryption
...
@@ -153,6 +157,7 @@ namespace HYH.Registry.Services.Encryption
/// 获取第一个mac地址
/// 获取第一个mac地址
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
AllowAnonymous
]
[
HttpGet
]
[
HttpGet
]
public
string
GetFirstMacAddress
()
public
string
GetFirstMacAddress
()
{
{
...
@@ -163,6 +168,7 @@ namespace HYH.Registry.Services.Encryption
...
@@ -163,6 +168,7 @@ namespace HYH.Registry.Services.Encryption
/// 获取Mac地址
/// 获取Mac地址
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
AllowAnonymous
]
[
HttpGet
]
[
HttpGet
]
public
string
GetMACIp
()
public
string
GetMACIp
()
{
{
...
@@ -173,6 +179,7 @@ namespace HYH.Registry.Services.Encryption
...
@@ -173,6 +179,7 @@ namespace HYH.Registry.Services.Encryption
/// 获取电脑名称
/// 获取电脑名称
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
AllowAnonymous
]
[
HttpGet
]
[
HttpGet
]
public
string
GetName
()
public
string
GetName
()
{
{
...
@@ -183,6 +190,7 @@ namespace HYH.Registry.Services.Encryption
...
@@ -183,6 +190,7 @@ namespace HYH.Registry.Services.Encryption
/// 获取硬盘序列号
/// 获取硬盘序列号
/// </summary>
/// </summary>
/// <returns></returns>
/// <returns></returns>
[
AllowAnonymous
]
[
HttpGet
]
[
HttpGet
]
public
string
GetHardDiskSerialNumber
()
public
string
GetHardDiskSerialNumber
()
{
{
...
@@ -190,15 +198,15 @@ namespace HYH.Registry.Services.Encryption
...
@@ -190,15 +198,15 @@ namespace HYH.Registry.Services.Encryption
return
hardDiskSerialNumber
;
return
hardDiskSerialNumber
;
}
}
/// <summary>
///
//
<summary>
/// 获取内网ip
///
//
获取内网ip
/// </summary>
///
//
</summary>
/// <returns></returns>
///
//
<returns></returns>
public
async
Task
<
object
>
GetInternalIP
()
//
public async Task<object> GetInternalIP()
{
//
{
var
InternalIP
=
ComputerInfoHelper
.
GetInternalIP
();
//
var InternalIP = ComputerInfoHelper.GetInternalIP();
return
InternalIP
.
ToString
();
//
return InternalIP.ToString();
}
//
}
}
}
}
}
src/HYH.Registry.Web.Host/HYH.Registry.Application.xml
View file @
2605dc7b
...
@@ -101,6 +101,16 @@
...
@@ -101,6 +101,16 @@
租户号
租户号
</summary>
</summary>
</member>
</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"
>
<member
name=
"T:HYH.Registry.Services.Encryption.EncryptionService"
>
<summary>
<summary>
...
@@ -136,7 +146,7 @@
...
@@ -136,7 +146,7 @@
<param
name=
"input"
></param>
<param
name=
"input"
></param>
<returns></returns>
<returns></returns>
</member>
</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>
登录的密文验证
登录的密文验证
</summary>
</summary>
...
@@ -178,11 +188,5 @@
...
@@ -178,11 +188,5 @@
</summary>
</summary>
<returns></returns>
<returns></returns>
</member>
</member>
<member
name=
"M:HYH.Registry.Services.Encryption.EncryptionService.GetInternalIP"
>
<summary>
获取内网ip
</summary>
<returns></returns>
</member>
</members>
</members>
</doc>
</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