refactor: 更新 BSM 最新版

权限授权使用与3.0相同的逻辑
This commit is contained in:
Argo Zhang 2019-09-27 22:07:27 +08:00
parent 6ccab20d73
commit 456363d952
No known key found for this signature in database
GPG Key ID: 152E398953DDF19F
3 changed files with 5 additions and 10 deletions

View File

@ -11,12 +11,11 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Bootstrap.Security.DataAccess" Version="2.2.21" /> <PackageReference Include="Bootstrap.Security.DataAccess" Version="2.2.21" />
<PackageReference Include="Bootstrap.Security.Mvc" Version="2.2.17" /> <PackageReference Include="Bootstrap.Security.Mvc" Version="3.0.0" />
<PackageReference Include="Longbow.Configuration" Version="2.2.7" /> <PackageReference Include="Longbow.Configuration" Version="2.2.7" />
<PackageReference Include="Longbow.Tasks" Version="2.2.23" /> <PackageReference Include="Longbow.Tasks" Version="2.2.23" />
<PackageReference Include="Microsoft.AspNetCore.App" /> <PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="3.1.6" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="3.1.6" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="2.2.3" PrivateAssets="All" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="Sentry.AspNetCore" Version="1.2.0" /> <PackageReference Include="Sentry.AspNetCore" Version="1.2.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" /> <PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />

View File

@ -1,6 +1,6 @@
using Bootstrap.Admin.Query; using Bootstrap.Admin.Query;
using Bootstrap.DataAccess; using Bootstrap.DataAccess;
using Bootstrap.Security; using Bootstrap.Security.Authentication;
using Longbow.Web.Mvc; using Longbow.Web.Mvc;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;

View File

@ -109,7 +109,8 @@ namespace Bootstrap.Admin
app.UseHttpsRedirection(); app.UseHttpsRedirection();
app.UseResponseCompression(); app.UseResponseCompression();
app.UseStaticFiles(); app.UseStaticFiles();
app.UseBootstrapAdminAuthentication(RoleHelper.RetrievesByUserName, RoleHelper.RetrievesByUrl, AppHelper.RetrievesByUserName); app.UseAuthentication();
app.UseBootstrapAdminAuthorization(RoleHelper.RetrievesByUserName, RoleHelper.RetrievesByUrl, AppHelper.RetrievesByUserName);
app.UseBootstrapHealthChecks(); app.UseBootstrapHealthChecks();
app.UseOnlineUsers(TraceHelper.Filter, TraceHelper.Save); app.UseOnlineUsers(TraceHelper.Filter, TraceHelper.Save);
app.UseCacheManager(); app.UseCacheManager();
@ -119,12 +120,7 @@ namespace Bootstrap.Admin
routes.MapHub<TaskLogHub>("/TaskLogHub"); routes.MapHub<TaskLogHub>("/TaskLogHub");
}); });
app.UseSwagger(Configuration["SwaggerPathBase"].TrimEnd('/')); app.UseSwagger(Configuration["SwaggerPathBase"].TrimEnd('/'));
app.UseMvc(routes => app.UseMvcWithDefaultRoute();
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
} }
} }
} }