![]() |
VOOZH | about |
dotnet add package Harbour.NETCore.CSnakes --version 8.2.1
NuGet\Install-Package Harbour.NETCore.CSnakes -Version 8.2.1
<PackageReference Include="Harbour.NETCore.CSnakes" Version="8.2.1" />
<PackageVersion Include="Harbour.NETCore.CSnakes" Version="8.2.1" />Directory.Packages.props
<PackageReference Include="Harbour.NETCore.CSnakes" />Project file
paket add Harbour.NETCore.CSnakes --version 8.2.1
#r "nuget: Harbour.NETCore.CSnakes, 8.2.1"
#:package Harbour.NETCore.CSnakes@8.2.1
#addin nuget:?package=Harbour.NETCore.CSnakes&version=8.2.1Install as a Cake Addin
#tool nuget:?package=Harbour.NETCore.CSnakes&version=8.2.1Install as a Cake Tool
Harbour.AspNetCore 是将Furion项目最小化拆分,并移除部分特性的AspNetCore6工具集
先注册 .AddNewtonsoftJson() 再注册AddUnifyResult()
if (env.IsDevelopment())
app.UseDeveloperExceptionPage();
// 添加规范化结果状态码,需要在这里注册
app.UseUnifyResultStatusCodes();
app.UseStaticFiles();
//启用会话
app.UseSession();
app.UseRouting();
// 跨域
app.UseCorsAccessor();
// vue 路由
app.UseVueRouterHistory();
//启用登陆验证
app.UseAuthentication();
app.UseAuthorization();
// 规范化文档
app.UseSpecificationDocuments();
// FineUI 和 MVC 中间件(确保 UseFineUI 位于 UseMvc 的前面)
app.UseFineUI();
app.UseEndpoints(endpoints =>());
1、services.AddUnifyResult();
2、实现IValidationMessageTypeProvider可验证消息类型提供器
3、实现IErrorCodeTypeProvider可异常错误代码提供器
通过DataValidationFilter过滤器(IActionFilter),拦截验证失败返回结果,实现对响应数据验证的处理 通过IAsyncExceptionFilter过滤器(IAsyncExceptionFilter),拦截抛出异常的返回结果,实现对响应友好异常的处理 通过UnifyResultFilter过滤器(IAsyncActionFilter),实现对响应成功的结果规范化处理
1、services.AddUnifyResult(); app.UseUnifyResultStatusCodes();
通过注册UnifyResultStatusCodesMiddleware中间件,实现对所有Response的拦截并解析StatusCode>=400且StatusCode!=404的响应 并将401、403的状态码改为200,规范化返回内容
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.