parent
74385bb165
commit
4dda70f07e
51 changed files with 411 additions and 2611 deletions
@ -1,4 +1,412 @@ |
|||||||
*.csproj |
<<<<<<< HEAD |
||||||
|
packages/ |
||||||
|
AutoUpdate/ |
||||||
|
ConsoleApp/ |
||||||
|
DicomTool/ |
||||||
|
IDCardRead/ |
||||||
|
PublishUpgrade/ |
||||||
|
Scale/ |
||||||
|
PEIS/PEIS.zip |
||||||
|
# ---> VisualStudio |
||||||
|
## Ignore Visual Studio temporary files, build results, and |
||||||
|
## files generated by popular Visual Studio add-ons. |
||||||
|
## |
||||||
|
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore |
||||||
|
|
||||||
|
# User-specific files |
||||||
|
*.rsuser |
||||||
|
*.suo |
||||||
|
*.user |
||||||
|
*.userosscache |
||||||
|
*.sln.docstates |
||||||
|
|
||||||
|
# User-specific files (MonoDevelop/Xamarin Studio) |
||||||
|
*.userprefs |
||||||
|
|
||||||
|
# Mono auto generated files |
||||||
|
mono_crash.* |
||||||
|
|
||||||
|
# Build results |
||||||
|
[Dd]ebug/ |
||||||
|
[Dd]ebugPublic/ |
||||||
|
[Rr]elease/ |
||||||
|
[Rr]eleases/ |
||||||
|
x64/ |
||||||
|
x86/ |
||||||
|
[Ww][Ii][Nn]32/ |
||||||
|
[Aa][Rr][Mm]/ |
||||||
|
[Aa][Rr][Mm]64/ |
||||||
|
bld/ |
||||||
|
[Bb]in/ |
||||||
|
[Oo]bj/ |
||||||
|
[Ll]og/ |
||||||
|
[Ll]ogs/ |
||||||
|
|
||||||
|
# Visual Studio 2015/2017 cache/options directory |
||||||
.vs/ |
.vs/ |
||||||
bin/ |
# Uncomment if you have tasks that create the project's static files in wwwroot |
||||||
obj/ |
#wwwroot/ |
||||||
|
|
||||||
|
# Visual Studio 2017 auto generated files |
||||||
|
Generated\ Files/ |
||||||
|
|
||||||
|
# MSTest test Results |
||||||
|
[Tt]est[Rr]esult*/ |
||||||
|
[Bb]uild[Ll]og.* |
||||||
|
|
||||||
|
# NUnit |
||||||
|
*.VisualState.xml |
||||||
|
TestResult.xml |
||||||
|
nunit-*.xml |
||||||
|
|
||||||
|
# Build Results of an ATL Project |
||||||
|
[Dd]ebugPS/ |
||||||
|
[Rr]eleasePS/ |
||||||
|
dlldata.c |
||||||
|
|
||||||
|
# Benchmark Results |
||||||
|
BenchmarkDotNet.Artifacts/ |
||||||
|
|
||||||
|
# .NET Core |
||||||
|
project.lock.json |
||||||
|
project.fragment.lock.json |
||||||
|
artifacts/ |
||||||
|
|
||||||
|
# ASP.NET Scaffolding |
||||||
|
ScaffoldingReadMe.txt |
||||||
|
|
||||||
|
# StyleCop |
||||||
|
StyleCopReport.xml |
||||||
|
|
||||||
|
# Files built by Visual Studio |
||||||
|
*_i.c |
||||||
|
*_p.c |
||||||
|
*_h.h |
||||||
|
*.ilk |
||||||
|
*.meta |
||||||
|
*.obj |
||||||
|
*.iobj |
||||||
|
*.pch |
||||||
|
*.pdb |
||||||
|
*.ipdb |
||||||
|
*.pgc |
||||||
|
*.pgd |
||||||
|
*.rsp |
||||||
|
*.sbr |
||||||
|
*.tlb |
||||||
|
*.tli |
||||||
|
*.tlh |
||||||
|
*.tmp |
||||||
|
*.tmp_proj |
||||||
|
*_wpftmp.csproj |
||||||
|
*.log |
||||||
|
*.tlog |
||||||
|
*.vspscc |
||||||
|
*.vssscc |
||||||
|
.builds |
||||||
|
*.pidb |
||||||
|
*.svclog |
||||||
|
*.scc |
||||||
|
|
||||||
|
# Chutzpah Test files |
||||||
|
_Chutzpah* |
||||||
|
|
||||||
|
# Visual C++ cache files |
||||||
|
ipch/ |
||||||
|
*.aps |
||||||
|
*.ncb |
||||||
|
*.opendb |
||||||
|
*.opensdf |
||||||
|
*.sdf |
||||||
|
*.cachefile |
||||||
|
*.VC.db |
||||||
|
*.VC.VC.opendb |
||||||
|
|
||||||
|
# Visual Studio profiler |
||||||
|
*.psess |
||||||
|
*.vsp |
||||||
|
*.vspx |
||||||
|
*.sap |
||||||
|
|
||||||
|
# Visual Studio Trace Files |
||||||
|
*.e2e |
||||||
|
|
||||||
|
# TFS 2012 Local Workspace |
||||||
|
$tf/ |
||||||
|
|
||||||
|
# Guidance Automation Toolkit |
||||||
|
*.gpState |
||||||
|
|
||||||
|
# ReSharper is a .NET coding add-in |
||||||
|
_ReSharper*/ |
||||||
|
*.[Rr]e[Ss]harper |
||||||
|
*.DotSettings.user |
||||||
|
|
||||||
|
# TeamCity is a build add-in |
||||||
|
_TeamCity* |
||||||
|
|
||||||
|
# DotCover is a Code Coverage Tool |
||||||
|
*.dotCover |
||||||
|
|
||||||
|
# AxoCover is a Code Coverage Tool |
||||||
|
.axoCover/* |
||||||
|
!.axoCover/settings.json |
||||||
|
|
||||||
|
# Coverlet is a free, cross platform Code Coverage Tool |
||||||
|
coverage*.json |
||||||
|
coverage*.xml |
||||||
|
coverage*.info |
||||||
|
|
||||||
|
# Visual Studio code coverage results |
||||||
|
*.coverage |
||||||
|
*.coveragexml |
||||||
|
|
||||||
|
# NCrunch |
||||||
|
_NCrunch_* |
||||||
|
.*crunch*.local.xml |
||||||
|
nCrunchTemp_* |
||||||
|
|
||||||
|
# MightyMoose |
||||||
|
*.mm.* |
||||||
|
AutoTest.Net/ |
||||||
|
|
||||||
|
# Web workbench (sass) |
||||||
|
.sass-cache/ |
||||||
|
|
||||||
|
# Installshield output folder |
||||||
|
[Ee]xpress/ |
||||||
|
|
||||||
|
# DocProject is a documentation generator add-in |
||||||
|
DocProject/buildhelp/ |
||||||
|
DocProject/Help/*.HxT |
||||||
|
DocProject/Help/*.HxC |
||||||
|
DocProject/Help/*.hhc |
||||||
|
DocProject/Help/*.hhk |
||||||
|
DocProject/Help/*.hhp |
||||||
|
DocProject/Help/Html2 |
||||||
|
DocProject/Help/html |
||||||
|
|
||||||
|
# Click-Once directory |
||||||
|
publish/ |
||||||
|
|
||||||
|
# Publish Web Output |
||||||
|
*.[Pp]ublish.xml |
||||||
|
*.azurePubxml |
||||||
|
# Note: Comment the next line if you want to checkin your web deploy settings, |
||||||
|
# but database connection strings (with potential passwords) will be unencrypted |
||||||
|
*.pubxml |
||||||
|
*.publishproj |
||||||
|
|
||||||
|
# Microsoft Azure Web App publish settings. Comment the next line if you want to |
||||||
|
# checkin your Azure Web App publish settings, but sensitive information contained |
||||||
|
# in these scripts will be unencrypted |
||||||
|
PublishScripts/ |
||||||
|
|
||||||
|
# NuGet Packages |
||||||
|
*.nupkg |
||||||
|
# NuGet Symbol Packages |
||||||
|
*.snupkg |
||||||
|
# The packages folder can be ignored because of Package Restore |
||||||
|
**/[Pp]ackages/* |
||||||
|
# except build/, which is used as an MSBuild target. |
||||||
|
!**/[Pp]ackages/build/ |
||||||
|
# Uncomment if necessary however generally it will be regenerated when needed |
||||||
|
#!**/[Pp]ackages/repositories.config |
||||||
|
# NuGet v3's project.json files produces more ignorable files |
||||||
|
*.nuget.props |
||||||
|
*.nuget.targets |
||||||
|
|
||||||
|
# Microsoft Azure Build Output |
||||||
|
csx/ |
||||||
|
*.build.csdef |
||||||
|
|
||||||
|
# Microsoft Azure Emulator |
||||||
|
ecf/ |
||||||
|
rcf/ |
||||||
|
|
||||||
|
# Windows Store app package directories and files |
||||||
|
AppPackages/ |
||||||
|
BundleArtifacts/ |
||||||
|
Package.StoreAssociation.xml |
||||||
|
_pkginfo.txt |
||||||
|
*.appx |
||||||
|
*.appxbundle |
||||||
|
*.appxupload |
||||||
|
|
||||||
|
# Visual Studio cache files |
||||||
|
# files ending in .cache can be ignored |
||||||
|
*.[Cc]ache |
||||||
|
# but keep track of directories ending in .cache |
||||||
|
!?*.[Cc]ache/ |
||||||
|
|
||||||
|
# Others |
||||||
|
ClientBin/ |
||||||
|
~$* |
||||||
|
*~ |
||||||
|
*.dbmdl |
||||||
|
*.dbproj.schemaview |
||||||
|
*.jfm |
||||||
|
*.pfx |
||||||
|
*.publishsettings |
||||||
|
orleans.codegen.cs |
||||||
|
|
||||||
|
# Including strong name files can present a security risk |
||||||
|
# (https://github.com/github/gitignore/pull/2483#issue-259490424) |
||||||
|
#*.snk |
||||||
|
|
||||||
|
# Since there are multiple workflows, uncomment next line to ignore bower_components |
||||||
|
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) |
||||||
|
#bower_components/ |
||||||
|
|
||||||
|
# RIA/Silverlight projects |
||||||
|
Generated_Code/ |
||||||
|
|
||||||
|
# Backup & report files from converting an old project file |
||||||
|
# to a newer Visual Studio version. Backup files are not needed, |
||||||
|
# because we have git ;-) |
||||||
|
_UpgradeReport_Files/ |
||||||
|
Backup*/ |
||||||
|
UpgradeLog*.XML |
||||||
|
UpgradeLog*.htm |
||||||
|
ServiceFabricBackup/ |
||||||
|
*.rptproj.bak |
||||||
|
|
||||||
|
# SQL Server files |
||||||
|
*.mdf |
||||||
|
*.ldf |
||||||
|
*.ndf |
||||||
|
|
||||||
|
# Business Intelligence projects |
||||||
|
*.rdl.data |
||||||
|
*.bim.layout |
||||||
|
*.bim_*.settings |
||||||
|
*.rptproj.rsuser |
||||||
|
*- [Bb]ackup.rdl |
||||||
|
*- [Bb]ackup ([0-9]).rdl |
||||||
|
*- [Bb]ackup ([0-9][0-9]).rdl |
||||||
|
|
||||||
|
# Microsoft Fakes |
||||||
|
FakesAssemblies/ |
||||||
|
|
||||||
|
# GhostDoc plugin setting file |
||||||
|
*.GhostDoc.xml |
||||||
|
|
||||||
|
# Node.js Tools for Visual Studio |
||||||
|
.ntvs_analysis.dat |
||||||
|
node_modules/ |
||||||
|
|
||||||
|
# Visual Studio 6 build log |
||||||
|
*.plg |
||||||
|
|
||||||
|
# Visual Studio 6 workspace options file |
||||||
|
*.opt |
||||||
|
|
||||||
|
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) |
||||||
|
*.vbw |
||||||
|
|
||||||
|
# Visual Studio 6 auto-generated project file (contains which files were open etc.) |
||||||
|
*.vbp |
||||||
|
|
||||||
|
# Visual Studio 6 workspace and project file (working project files containing files to include in project) |
||||||
|
*.dsw |
||||||
|
*.dsp |
||||||
|
|
||||||
|
# Visual Studio 6 technical files |
||||||
|
*.ncb |
||||||
|
*.aps |
||||||
|
|
||||||
|
# Visual Studio LightSwitch build output |
||||||
|
**/*.HTMLClient/GeneratedArtifacts |
||||||
|
**/*.DesktopClient/GeneratedArtifacts |
||||||
|
**/*.DesktopClient/ModelManifest.xml |
||||||
|
**/*.Server/GeneratedArtifacts |
||||||
|
**/*.Server/ModelManifest.xml |
||||||
|
_Pvt_Extensions |
||||||
|
|
||||||
|
# Paket dependency manager |
||||||
|
.paket/paket.exe |
||||||
|
paket-files/ |
||||||
|
|
||||||
|
# FAKE - F# Make |
||||||
|
.fake/ |
||||||
|
|
||||||
|
# CodeRush personal settings |
||||||
|
.cr/personal |
||||||
|
|
||||||
|
# Python Tools for Visual Studio (PTVS) |
||||||
|
__pycache__/ |
||||||
|
*.pyc |
||||||
|
|
||||||
|
# Cake - Uncomment if you are using it |
||||||
|
# tools/** |
||||||
|
# !tools/packages.config |
||||||
|
|
||||||
|
# Tabs Studio |
||||||
|
*.tss |
||||||
|
|
||||||
|
# Telerik's JustMock configuration file |
||||||
|
*.jmconfig |
||||||
|
|
||||||
|
# BizTalk build output |
||||||
|
*.btp.cs |
||||||
|
*.btm.cs |
||||||
|
*.odx.cs |
||||||
|
*.xsd.cs |
||||||
|
|
||||||
|
# OpenCover UI analysis results |
||||||
|
OpenCover/ |
||||||
|
|
||||||
|
# Azure Stream Analytics local run output |
||||||
|
ASALocalRun/ |
||||||
|
|
||||||
|
# MSBuild Binary and Structured Log |
||||||
|
*.binlog |
||||||
|
|
||||||
|
# NVidia Nsight GPU debugger configuration file |
||||||
|
*.nvuser |
||||||
|
|
||||||
|
# MFractors (Xamarin productivity tool) working folder |
||||||
|
.mfractor/ |
||||||
|
|
||||||
|
# Local History for Visual Studio |
||||||
|
.localhistory/ |
||||||
|
|
||||||
|
# Visual Studio History (VSHistory) files |
||||||
|
.vshistory/ |
||||||
|
|
||||||
|
# BeatPulse healthcheck temp database |
||||||
|
healthchecksdb |
||||||
|
|
||||||
|
# Backup folder for Package Reference Convert tool in Visual Studio 2017 |
||||||
|
MigrationBackup/ |
||||||
|
|
||||||
|
# Ionide (cross platform F# VS Code tools) working folder |
||||||
|
.ionide/ |
||||||
|
|
||||||
|
# Fody - auto-generated XML schema |
||||||
|
FodyWeavers.xsd |
||||||
|
|
||||||
|
# VS Code files for those working on multiple tools |
||||||
|
.vscode/* |
||||||
|
!.vscode/settings.json |
||||||
|
!.vscode/tasks.json |
||||||
|
!.vscode/launch.json |
||||||
|
!.vscode/extensions.json |
||||||
|
*.code-workspace |
||||||
|
|
||||||
|
# Local History for Visual Studio Code |
||||||
|
.history/ |
||||||
|
|
||||||
|
# Windows Installer files from build outputs |
||||||
|
*.cab |
||||||
|
*.msi |
||||||
|
*.msix |
||||||
|
*.msm |
||||||
|
*.msp |
||||||
|
|
||||||
|
# JetBrains Rider |
||||||
|
*.sln.iml |
||||||
|
|
||||||
|
# ---> SVN |
||||||
|
.svn/ |
||||||
|
|
||||||
|
|||||||
@ -1,21 +0,0 @@ |
|||||||
using Microsoft.AspNetCore.Hosting; |
|
||||||
using Microsoft.Extensions.Hosting; |
|
||||||
using NLog.Web; |
|
||||||
|
|
||||||
namespace PEIS.Cloud |
|
||||||
{ |
|
||||||
public class Program |
|
||||||
{ |
|
||||||
public static void Main(string[] args) |
|
||||||
{ |
|
||||||
CreateHostBuilder(args).UseNLog().Build().Run(); |
|
||||||
} |
|
||||||
|
|
||||||
public static IHostBuilder CreateHostBuilder(string[] args) => |
|
||||||
Host.CreateDefaultBuilder(args) |
|
||||||
.ConfigureWebHostDefaults(webBuilder => |
|
||||||
{ |
|
||||||
webBuilder.UseStartup<Startup>(); |
|
||||||
}); |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,167 +0,0 @@ |
|||||||
using System; |
|
||||||
using System.Collections.Generic; |
|
||||||
using System.IO; |
|
||||||
using System.Reflection; |
|
||||||
using System.Text; |
|
||||||
using Microsoft.AspNetCore.Authentication.JwtBearer; |
|
||||||
using Microsoft.AspNetCore.Builder; |
|
||||||
using Microsoft.AspNetCore.Hosting; |
|
||||||
using Microsoft.Extensions.Configuration; |
|
||||||
using Microsoft.Extensions.DependencyInjection; |
|
||||||
using Microsoft.Extensions.Hosting; |
|
||||||
using Microsoft.IdentityModel.Tokens; |
|
||||||
using Microsoft.OpenApi.Models; |
|
||||||
using PEIS.Common.Helper.Encryption; |
|
||||||
using PEIS.Common.Middleware; |
|
||||||
|
|
||||||
namespace PEIS.Cloud |
|
||||||
{ |
|
||||||
public class Startup |
|
||||||
{ |
|
||||||
|
|
||||||
public Startup(IConfiguration configuration) |
|
||||||
{ |
|
||||||
Configuration = configuration; |
|
||||||
} |
|
||||||
|
|
||||||
private readonly bool _swagger = AppSettingJsonHelper.GetSection("Swagger", "Using") == "true"; |
|
||||||
public IConfiguration Configuration { get; } |
|
||||||
|
|
||||||
/// <summary> |
|
||||||
/// 这个方法被运行时调用。 使用此方法向容器添加服务 |
|
||||||
/// </summary> |
|
||||||
/// <param name="services"></param> |
|
||||||
public void ConfigureServices(IServiceCollection services) |
|
||||||
{ |
|
||||||
services.AddControllers(); |
|
||||||
services.AddControllersWithViews() |
|
||||||
.AddNewtonsoftJson(options => |
|
||||||
options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore |
|
||||||
); |
|
||||||
// swagger 配置 |
|
||||||
if (_swagger) |
|
||||||
{ |
|
||||||
services.AddSwaggerGen(c => |
|
||||||
{ |
|
||||||
c.SwaggerDoc("v1", new OpenApiInfo { Title = "OutCollect", Version = "v1" }); |
|
||||||
var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml"; |
|
||||||
var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); |
|
||||||
c.IncludeXmlComments(xmlPath, true); |
|
||||||
|
|
||||||
//添加Authorization |
|
||||||
c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme |
|
||||||
{ |
|
||||||
Description = "JWT Authorization header using the Bearer scheme.", |
|
||||||
Name = "Authorization", |
|
||||||
In = ParameterLocation.Header, |
|
||||||
Scheme = "bearer", |
|
||||||
Type = SecuritySchemeType.Http, |
|
||||||
BearerFormat = "JWT" |
|
||||||
}); |
|
||||||
//把所有方法配置为增加bearer头部信息; |
|
||||||
c.AddSecurityRequirement(new OpenApiSecurityRequirement |
|
||||||
{ |
|
||||||
{ |
|
||||||
new OpenApiSecurityScheme |
|
||||||
{ |
|
||||||
Reference = new OpenApiReference |
|
||||||
{ |
|
||||||
Type = ReferenceType.SecurityScheme, |
|
||||||
Id = "bearerAuth" |
|
||||||
} |
|
||||||
}, |
|
||||||
new string[] {} |
|
||||||
} |
|
||||||
}); |
|
||||||
|
|
||||||
c.AddSecurityRequirement(new OpenApiSecurityRequirement |
|
||||||
{ |
|
||||||
{ |
|
||||||
new OpenApiSecurityScheme |
|
||||||
{ |
|
||||||
Reference = new OpenApiReference { Type = ReferenceType.SecurityScheme, Id = "Bearer" } |
|
||||||
}, |
|
||||||
new List<string>() |
|
||||||
} |
|
||||||
}); |
|
||||||
}); |
|
||||||
} |
|
||||||
// jwt 配置 |
|
||||||
services.AddAuthentication(options => |
|
||||||
{ |
|
||||||
// 设置默认使用jwt验证方式 |
|
||||||
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; |
|
||||||
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; |
|
||||||
}).AddJwtBearer(options => |
|
||||||
{ |
|
||||||
var confSection = Configuration.GetSection("Authentication"); |
|
||||||
options.TokenValidationParameters = new TokenValidationParameters() |
|
||||||
{ |
|
||||||
// 验证接收者 |
|
||||||
ValidateAudience = true, |
|
||||||
// 验证发布者 //是否验证发行人,就是验证载荷中的Iss是否对应ValidIssuer参数 |
|
||||||
ValidateIssuer = true, |
|
||||||
// 验证过期时间//是否验证过期时间,过期了就拒绝访问 |
|
||||||
ValidateLifetime = true, |
|
||||||
// 验证秘钥 //是否验证签名,不验证的画可以篡改数据,不安全 |
|
||||||
ValidateIssuerSigningKey = true, |
|
||||||
// 读配置Issuer//发行人 |
|
||||||
ValidIssuer = confSection["IsSure"], |
|
||||||
// 读配置Audience//订阅人 |
|
||||||
ValidAudience = confSection["Audience"], |
|
||||||
// 设置生成token的秘钥 //解密的密钥 |
|
||||||
IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(confSection["SecurityKey"])) |
|
||||||
}; |
|
||||||
}); |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
/// <summary> |
|
||||||
/// 此方法由运行时调用。 使用此方法配置 HTTP 请求管道 |
|
||||||
/// </summary> |
|
||||||
/// <param name="app"></param> |
|
||||||
/// <param name="env"></param> |
|
||||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) |
|
||||||
{ |
|
||||||
if (env.IsDevelopment()) |
|
||||||
{ |
|
||||||
app.UseDeveloperExceptionPage(); |
|
||||||
} |
|
||||||
else |
|
||||||
{ |
|
||||||
app.UseExceptionHandler("/error"); |
|
||||||
} |
|
||||||
|
|
||||||
if (_swagger) |
|
||||||
{ |
|
||||||
app.UseSwagger(); |
|
||||||
// Enable middleware to serve generated Swagger as a JSON endpoint. |
|
||||||
app.UseSwagger(c => |
|
||||||
{ |
|
||||||
c.SerializeAsV2 = true; |
|
||||||
}); |
|
||||||
app.UseSwaggerUI(c => |
|
||||||
{ |
|
||||||
c.SwaggerEndpoint("/swagger/v1/swagger.json", "debug NetFL v1"); |
|
||||||
}); |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
app.UseHttpsRedirection(); |
|
||||||
app.UseRouting(); |
|
||||||
|
|
||||||
|
|
||||||
// custom jwt auth middleware |
|
||||||
app.UseMiddleware<JwtMiddleware>(); |
|
||||||
// jwt |
|
||||||
app.UseAuthentication(); |
|
||||||
app.UseAuthorization(); |
|
||||||
|
|
||||||
app.UseEndpoints(endpoints => |
|
||||||
{ |
|
||||||
endpoints.MapControllers(); |
|
||||||
}); |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,9 +0,0 @@ |
|||||||
{ |
|
||||||
"Logging": { |
|
||||||
"LogLevel": { |
|
||||||
"Default": "Information", |
|
||||||
"Microsoft": "Warning", |
|
||||||
"Microsoft.Hosting.Lifetime": "Information" |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,18 +0,0 @@ |
|||||||
{ |
|
||||||
"Logging": { |
|
||||||
"LogLevel": { |
|
||||||
"Default": "Information", |
|
||||||
"Microsoft": "Warning", |
|
||||||
"Microsoft.Hosting.Lifetime": "Information" |
|
||||||
} |
|
||||||
}, |
|
||||||
"AllowedHosts": "*", |
|
||||||
"Authentication": { |
|
||||||
"IsSure": "OutCollect", |
|
||||||
"Audience": "OutCollectColoud", |
|
||||||
"SecurityKey": "4C6A8A8B-1B9F-12E7-60C4-123BC0BB5D25" |
|
||||||
}, |
|
||||||
"Swagger": { |
|
||||||
"Using": "true" |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,18 +0,0 @@ |
|||||||
using NLog; |
|
||||||
|
|
||||||
namespace PEIS.Common.Helper.Nlog |
|
||||||
{ |
|
||||||
/// <summary> |
|
||||||
/// 日志静态类 |
|
||||||
/// </summary> |
|
||||||
public class LogHelper |
|
||||||
{ |
|
||||||
|
|
||||||
/// <summary> |
|
||||||
/// 日志调用对象 |
|
||||||
/// </summary> |
|
||||||
public static readonly NLog.Logger Log = LogManager.GetCurrentClassLogger(); |
|
||||||
|
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
@ -1,30 +0,0 @@ |
|||||||
<?xml version="1.0" encoding="utf-8" ?> |
|
||||||
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" |
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
||||||
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd" |
|
||||||
autoReload="true" |
|
||||||
throwExceptions="true" |
|
||||||
internalLogLevel="Off" internalLogFile="log\console.log"> |
|
||||||
|
|
||||||
<targets> |
|
||||||
<target name="console" xsi:type="ColoredConsole" |
|
||||||
layout="${date:format=HH\:mm\:ss}> ${message}"/> |
|
||||||
|
|
||||||
<!--VS输出窗口--> |
|
||||||
<target name="debugger" xsi:type="Debugger" |
|
||||||
layout="${date:format=HH\:mm\:ss} | ${level:padding=-5} | ${message}" /> |
|
||||||
|
|
||||||
<target name="info" xsi:type="File" fileName="${basedir}/Logs/Info/${shortdate}/info.txt" layout="${date:format=HH\:mm\:ss} | ${level:padding=-5} | ${message}" /> |
|
||||||
|
|
||||||
<!--保存至文件--> |
|
||||||
<target name="error_file" xsi:type="File" maxArchiveFiles="30" |
|
||||||
fileName="${basedir}/Logs/Error/${shortdate}/error.txt" |
|
||||||
layout="${longdate} | ${level:uppercase=false:padding=-5} | ${message} ${onexception:${exception:format=tostring} ${newline} ${stacktrace} ${newline}" /> |
|
||||||
</targets> |
|
||||||
<rules> |
|
||||||
|
|
||||||
<logger name="*" minlevel="Debug" writeTo="debugger" /> |
|
||||||
<logger name="*" minlevel="Info" writeTo="info" /> |
|
||||||
<logger name="*" minlevel="Error" writeTo="error_file" /> |
|
||||||
</rules> |
|
||||||
</nlog> |
|
||||||
@ -1,41 +0,0 @@ |
|||||||
# .net core 3.1 web Api 帮助类合集 |
|
||||||
1. Auth(Jwt相关的帮助类): |
|
||||||
- AuthHelper |
|
||||||
- JwtHelper |
|
||||||
2. Cache(缓存) 适用于web Api的项目,需要传入IMemoryCache |
|
||||||
- CacheHelper |
|
||||||
3. Code(二维码) 生成二维码的帮助类,可以生成带标题,图标的二维码以及空二维码 |
|
||||||
- CodeHelper |
|
||||||
4. Encryption(加解密) |
|
||||||
- AppSettingJsonHelper web Api的配置帮助类 |
|
||||||
- ConnectionStringHelper 连接字符串解密(EF的) |
|
||||||
- DesHelper Des加解密 |
|
||||||
- RsaHelper 公私钥加解密 |
|
||||||
5. Entity (实体类型的一些互相转换) => 反射来实现 |
|
||||||
- ModelToEntity |
|
||||||
6. Excel 读取excel的操作 |
|
||||||
- ExcelHelper |
|
||||||
7. File 对于文件的操作 (文件的删除创建判断存在之类的) |
|
||||||
- FileHelper |
|
||||||
8. Nlog 日志的帮助类 |
|
||||||
- LogHelper |
|
||||||
9. Page 分页的帮助类 |
|
||||||
- PageHelper |
|
||||||
10. Redis |
|
||||||
- RedisHelper Redis的帮助类 |
|
||||||
11. Request http get post 的各种请求以及返回回来不同类型的参数 |
|
||||||
- RequestHelper |
|
||||||
12. Response 返回的规范定义 所有接口返回值必须返回这个类型 |
|
||||||
- ResponseHepler |
|
||||||
13. SqlServer sqlserver的原生操作 (推荐观看) |
|
||||||
- SqlHelper |
|
||||||
14. StringText 字符的相关操作类 |
|
||||||
- CodeHelper 获取文本数字码(不是文本里面的数字,数字码意义自己搜索) |
|
||||||
- PinYinHelper 获取首字母之类的 |
|
||||||
- TypeChange 流的转换 |
|
||||||
15. Verify 验证 |
|
||||||
- IdCardHelper 身份证验证 |
|
||||||
16. WeChat 微信的帮助类,调用微信接口的(可以看,不要尝试,会影响我们正式业务,token会互冲) |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in new issue