diff --git a/OpenAuth.WebApi/Controllers/CheckController.cs b/OpenAuth.WebApi/Controllers/CheckController.cs
index 7fa488b6..e93c5288 100644
--- a/OpenAuth.WebApi/Controllers/CheckController.cs
+++ b/OpenAuth.WebApi/Controllers/CheckController.cs
@@ -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
///
/// 登录接口
+ /// 该接口可以在swagger中查看mini profiler效果
///
/// 登录参数
///
@@ -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)
{
diff --git a/OpenAuth.WebApi/OpenAuth.WebApi.csproj b/OpenAuth.WebApi/OpenAuth.WebApi.csproj
index a1e46b70..82b138f4 100644
--- a/OpenAuth.WebApi/OpenAuth.WebApi.csproj
+++ b/OpenAuth.WebApi/OpenAuth.WebApi.csproj
@@ -31,10 +31,10 @@
-
+
diff --git a/OpenAuth.WebApi/Startup.cs b/OpenAuth.WebApi/Startup.cs
index 31a12e74..0b50234e 100644
--- a/OpenAuth.WebApi/Startup.cs
+++ b/OpenAuth.WebApi/Startup.cs
@@ -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.),