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
8fedda00
Commit
8fedda00
authored
Aug 18, 2021
by
zhanglongtao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
c0ef3bff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
7 deletions
+22
-7
EncryptionService.cs
...stry.Application/Services/Encryption/EncryptionService.cs
+16
-5
HYH.Registry.EntityFrameworkCore.csproj
...tityFrameworkCore/HYH.Registry.EntityFrameworkCore.csproj
+1
-0
appsettings.json
src/HYH.Registry.Web.Host/appsettings.json
+5
-2
No files found.
src/HYH.Registry.Application/Services/Encryption/EncryptionService.cs
View file @
8fedda00
...
...
@@ -2,11 +2,14 @@
using
Abp.Domain.Repositories
;
using
HYH.AspNetCore
;
using
HYH.Core.DbModels
;
using
HYH.Registry.DbModels
;
using
HYH.Registry.EntityFrameworkCore
;
using
HYH.SqlSugarCore
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.EntityFrameworkCore
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
HYH.Registry.Services.Encryption
...
...
@@ -17,22 +20,25 @@ namespace HYH.Registry.Services.Encryption
public
class
EncryptionService
:
ApplicationService
{
private
readonly
ICurrentUser
_currentUser
;
//
private readonly RegistryDbContext _dbContext;
//
private readonly DbContext<Tenant> _dbTenant;
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,
RegistryDbContext
dbContext
,
DbContext
<
Tenant
>
dbTenant
,
IRepository
<
MaterialPowder
,
int
>
repMaterialPowder
,
IRepository
<
Tenant
,
int
>
repTenant
)
{
_repMaterialPowder
=
repMaterialPowder
;
_currentUser
=
currentUser
;
//
_dbContext = dbContext;
_dbContext
=
dbContext
;
// _dbTenant = dbTenant;
_repTenant
=
repTenant
;
...
...
@@ -46,6 +52,10 @@ 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
=
_dbContext
.
Tenants
.
ToList
();
string
netCardMACAddress
=
ComputerInfoHelper
.
GetNetCardMACAddress
();
return
netCardMACAddress
;
}
...
...
@@ -94,6 +104,7 @@ 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
companyName
=
tenant
.
Name
;
...
...
src/HYH.Registry.EntityFrameworkCore/HYH.Registry.EntityFrameworkCore.csproj
View file @
8fedda00
...
...
@@ -28,6 +28,7 @@
<ProjectReference Include="..\HYH.Registry.Core\HYH.Registry.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Abp.EntityFrameworkCore" Version="5.10.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
...
...
src/HYH.Registry.Web.Host/appsettings.json
View file @
8fedda00
{
"ConnectionStrings"
:
{
"Default"
:
"Server=39.100.148.168; Database=system; charset=utf8;user=root;password=root@Mysql8@228;port=3307;pooling=true;min pool size=1;max pool size=5;"
},
//
"Logging"
:
{
//
"IncludeScopes"
:
true
,
//
"LogLevel"
:
{
...
...
@@ -11,8 +14,8 @@
"ServerAddress"
:
"http://*:10160"
},
"apollo"
:
{
"AppId"
:
"saas_mes_
R
egistry"
,
"Env"
:
"Pro"
,
"AppId"
:
"saas_mes_
r
egistry"
,
"Env"
:
"Pro"
,
"Meta"
:
{
//
"MetaServer"
:
"http://39.100.148.168:8080"
,
"FAT"
:
"http://39.100.148.168:8082"
,
...
...
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