mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-08-23 22:11:35 +08:00
fix issue #I3SKUV 可以正常在swagger中使用mini profiler
This commit is contained in:
parent
64d55568d1
commit
c559f33037
@ -23,6 +23,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Infrastructure.Helpers;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using StackExchange.Profiling;
|
||||
|
||||
namespace OpenAuth.WebApi.Controllers
|
||||
{
|
||||
@ -331,6 +332,7 @@ namespace OpenAuth.WebApi.Controllers
|
||||
|
||||
/// <summary>
|
||||
/// 登录接口
|
||||
/// <para>该接口可以在swagger中查看mini profiler效果</para>
|
||||
/// </summary>
|
||||
/// <param name="request">登录参数</param>
|
||||
/// <returns></returns>
|
||||
@ -341,7 +343,10 @@ namespace OpenAuth.WebApi.Controllers
|
||||
var result = new LoginResult();
|
||||
try
|
||||
{
|
||||
result = _authUtil.Login(request.AppKey, request.Account, request.Password);
|
||||
using (MiniProfiler.Current.Step("Login"))
|
||||
{
|
||||
result = _authUtil.Login(request.AppKey, request.Account, request.Password);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -31,10 +31,10 @@
|
||||
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="3.1.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Log4Net.AspNetCore" Version="3.1.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.1.0" />
|
||||
<PackageReference Include="MiniProfiler" Version="4.2.22" />
|
||||
<PackageReference Include="MiniProfiler.AspNetCore" Version="4.2.22" />
|
||||
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.2.22" />
|
||||
<PackageReference Include="MiniProfiler.EntityFrameworkCore" Version="4.2.22" />
|
||||
<PackageReference Include="MiniProfiler.Shared" Version="4.2.22" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
|
||||
<PackageReference Include="NUnit" Version="3.13.1" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="3.17.0" />
|
||||
|
@ -203,6 +203,8 @@ namespace OpenAuth.WebApi
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
app.UseMiniProfiler();
|
||||
|
||||
//可以访问根目录下面的静态文件
|
||||
var staticfile = new StaticFileOptions
|
||||
{
|
||||
@ -232,8 +234,6 @@ namespace OpenAuth.WebApi
|
||||
//配置ServiceProvider
|
||||
AutofacContainerModule.ConfigServiceProvider(app.ApplicationServices);
|
||||
|
||||
app.UseMiniProfiler();
|
||||
|
||||
app.UseSwagger();
|
||||
|
||||
// Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.),
|
||||
|
Loading…
Reference in New Issue
Block a user