docs .
This commit is contained in:
@@ -15,6 +15,15 @@ namespace Dlhis.InfoCheck.Controllers;
|
|||||||
[Route("api/[controller]")]
|
[Route("api/[controller]")]
|
||||||
public class FaceController : ControllerBase
|
public class FaceController : ControllerBase
|
||||||
{
|
{
|
||||||
|
private readonly ILogger<FaceController> _logger;
|
||||||
|
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||||
|
|
||||||
|
public FaceController(ILogger<FaceController> logger, IHttpContextAccessor httpContextAccessor)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
_httpContextAccessor = httpContextAccessor;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 人脸质量检测
|
/// 人脸质量检测
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -24,6 +33,8 @@ public class FaceController : ControllerBase
|
|||||||
[HttpPost("detection")]
|
[HttpPost("detection")]
|
||||||
public IEnumerable<string> FacialDetection(FaceDetectRequest request)
|
public IEnumerable<string> FacialDetection(FaceDetectRequest request)
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation("currentIP:{IP}", _httpContextAccessor.HttpContext.Connection.RemoteIpAddress);
|
||||||
|
|
||||||
var base64Bytes = Convert.FromBase64String(request.Base64);
|
var base64Bytes = Convert.FromBase64String(request.Base64);
|
||||||
using var stream = new MemoryStream(base64Bytes);
|
using var stream = new MemoryStream(base64Bytes);
|
||||||
using var bitmap = SKBitmap.Decode(stream);
|
using var bitmap = SKBitmap.Decode(stream);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
using Kurisu.AspNetCore.Startup;
|
using Kurisu.AspNetCore.Startup;
|
||||||
using Kurisu.AspNetCore.Utils.Extensions;
|
using Microsoft.AspNetCore.HttpOverrides;
|
||||||
using Microsoft.IdentityModel.Logging;
|
using Microsoft.IdentityModel.Logging;
|
||||||
|
|
||||||
class Program
|
class Program
|
||||||
@@ -16,4 +16,23 @@ public class Startup : DefaultStartup
|
|||||||
{
|
{
|
||||||
IdentityModelEventSource.ShowPII = true;
|
IdentityModelEventSource.ShowPII = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void ConfigureServices(IServiceCollection services)
|
||||||
|
{
|
||||||
|
base.ConfigureServices(services);
|
||||||
|
services.AddHttpContextAccessor();
|
||||||
|
services.Configure<ForwardedHeadersOptions>(options =>
|
||||||
|
{
|
||||||
|
options.ForwardedHeaders = ForwardedHeaders.All;
|
||||||
|
|
||||||
|
options.KnownNetworks.Clear();
|
||||||
|
options.KnownProxies.Clear();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||||
|
{
|
||||||
|
app.UseForwardedHeaders();
|
||||||
|
base.Configure(app, env);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -38,18 +38,11 @@
|
|||||||
"ClientSecret": "123456"
|
"ClientSecret": "123456"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// "JinkoOptions": {
|
|
||||||
// "Jip": {
|
|
||||||
// "BaseUrl": "http://172.16.202.34:8000",
|
|
||||||
// "Key": "FACE-7409WIBX",
|
|
||||||
// "Secret": "be0a4b88-cd80-4509-b9b9-865205d0d3d8"
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
"JinkoOptions": {
|
"JinkoOptions": {
|
||||||
"Jip": {
|
"Jip": {
|
||||||
"BaseUrl": "http://jip.jinkosolar.com",
|
"BaseUrl": "http://172.16.202.34:8000",
|
||||||
"Key": "FACE-CUOJG9N7",
|
"Key": "FACE-7409WIBX",
|
||||||
"Secret": "130c2f2d-03a0-4720-8e25-538ffac7a7cb"
|
"Secret": "be0a4b88-cd80-4509-b9b9-865205d0d3d8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user