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
3f0d87e0
Commit
3f0d87e0
authored
Aug 19, 2021
by
zhanglongtao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
12b488dc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
17 deletions
+39
-17
ComputerInfoHelper.cs
...try.Application/Services/Encryption/ComputerInfoHelper.cs
+13
-0
EncryptionService.cs
...stry.Application/Services/Encryption/EncryptionService.cs
+13
-16
HYH.Registry.Application.xml
src/HYH.Registry.Web.Host/HYH.Registry.Application.xml
+13
-1
No files found.
src/HYH.Registry.Application/Services/Encryption/ComputerInfoHelper.cs
View file @
3f0d87e0
...
...
@@ -49,6 +49,19 @@ namespace HYH.Registry.Services.Encryption
}
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public
static
string
GetName
()
{
IPGlobalProperties
computerProperties
=
IPGlobalProperties
.
GetIPGlobalProperties
();
//获取本机电脑名
var
HostName
=
computerProperties
.
HostName
;
//获取域名
var
DomainName
=
computerProperties
.
DomainName
;
return
"电脑名:"
+
HostName
+
",域名:"
+
DomainName
;
}
/// <summary>
/// 获取电脑 MAC(物理) 地址
/// </summary>
/// <returns></returns>
...
...
src/HYH.Registry.Application/Services/Encryption/EncryptionService.cs
View file @
3f0d87e0
...
...
@@ -20,26 +20,17 @@ namespace HYH.Registry.Services.Encryption
public
class
EncryptionService
:
ApplicationService
{
private
readonly
ICurrentUser
_currentUser
;
// private readonly RegistryDbContext _dbContext;
private
readonly
DbContext
<
Tenant
>
_dbTenant
;
private
readonly
IRepository
<
Tenant
,
int
>
_repTenant
;
private
readonly
IRepository
<
MaterialPowder
,
int
>
_repMaterialPowder
;
/// <summary>
/// 构造函数
///</summary>
public
EncryptionService
(
ICurrentUser
currentUser
,
// RegistryDbContext dbContext,
DbContext
<
Tenant
>
dbTenant
,
IRepository
<
MaterialPowder
,
int
>
repMaterialPowder
,
IRepository
<
Tenant
,
int
>
repTenant
)
{
_repMaterialPowder
=
repMaterialPowder
;
_currentUser
=
currentUser
;
//_dbContext = dbContext;
// _dbTenant = dbTenant;
_repTenant
=
repTenant
;
...
...
@@ -52,10 +43,6 @@ namespace HYH.Registry.Services.Encryption
[
HttpGet
]
public
string
GetNetCardMACAddress
()
{
//var dfsff = _dbContext.Database.GetDbConnection().ConnectionString
string
code
=
_currentUser
.
TenantCode
;
var
tenant
=
_repTenant
.
FirstOrDefault
(
q
=>
q
.
Code
==
code
);
var
ddf
=
_repTenant
.
GetAll
().
ToList
();
string
netCardMACAddress
=
ComputerInfoHelper
.
GetNetCardMACAddress
();
return
netCardMACAddress
;
}
...
...
@@ -70,6 +57,16 @@ namespace HYH.Registry.Services.Encryption
return
netCardMACAddress
;
}
/// <summary>
/// 获取电脑名称
/// </summary>
/// <returns></returns>
[
HttpGet
]
public
string
GetName
()
{
string
netCardMACAddress
=
ComputerInfoHelper
.
GetName
();
return
netCardMACAddress
;
}
/// <summary>
/// 获取硬盘序列号
/// </summary>
/// <returns></returns>
...
...
@@ -104,11 +101,11 @@ namespace HYH.Registry.Services.Encryption
{
string
data
=
AESHelper
.
AESDecrypt
(
input
,
"jianzhukeji"
,
"jzkj"
);
string
code
=
_currentUser
.
TenantCode
;
var
tenant
=
_repTenant
.
FirstOrDefault
(
q
=>
q
.
Code
==
code
);
string
day
=
(
tenant
.
EndTime
-
tenant
.
StartTime
).
ToString
();
string
timestamp
=
(
tenant
.
EndTime
-
tenant
.
StartTime
).
ToString
();
string
companyName
=
tenant
.
Name
;
data
+=
"365"
+
"北京见著科技"
;
data
+=
timestamp
+
companyName
;
data
=
data
.
PadRight
(
72
);
var
datalen
=
data
.
Length
;
var
result
=
AESHelper
.
AESEncrypt
(
data
,
"jianzhukeji"
,
"jzkj"
);
var
length
=
result
.
Length
;
...
...
src/HYH.Registry.Web.Host/HYH.Registry.Application.xml
View file @
3f0d87e0
...
...
@@ -37,6 +37,12 @@
<param
name=
"Vector"
>
向量
</param>
<returns>
明文
</returns>
</member>
<member
name=
"M:HYH.Registry.Services.Encryption.ComputerInfoHelper.GetName"
>
<summary>
</summary>
<returns></returns>
</member>
<member
name=
"M:HYH.Registry.Services.Encryption.ComputerInfoHelper.GetMACIp"
>
<summary>
获取电脑 MAC(物理) 地址
...
...
@@ -48,7 +54,7 @@
</summary>
</member>
<member
name=
"M:HYH.Registry.Services.Encryption.EncryptionService.#ctor(HYH.AspNetCore.ICurrentUser,
HYH.SqlSugarCore.DbContext{HYH.Core.DbModels.Tenant},Abp.Domain.Repositories.IRepository{HYH.Registry.DbModels.MaterialPowder,System.Int32},
Abp.Domain.Repositories.IRepository{HYH.Core.DbModels.Tenant,System.Int32})"
>
<member
name=
"M:HYH.Registry.Services.Encryption.EncryptionService.#ctor(HYH.AspNetCore.ICurrentUser,Abp.Domain.Repositories.IRepository{HYH.Core.DbModels.Tenant,System.Int32})"
>
<summary>
构造函数
</summary>
...
...
@@ -65,6 +71,12 @@
</summary>
<returns></returns>
</member>
<member
name=
"M:HYH.Registry.Services.Encryption.EncryptionService.GetName"
>
<summary>
获取电脑名称
</summary>
<returns></returns>
</member>
<member
name=
"M:HYH.Registry.Services.Encryption.EncryptionService.GetHardDiskSerialNumber"
>
<summary>
获取硬盘序列号
...
...
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