refactor: Client 工程重构权限方式
This commit is contained in:
parent
38388148bc
commit
20d9dad2ee
|
@ -1,4 +1,5 @@
|
|||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Bootstrap.Client.Controllers.Api
|
||||
{
|
||||
|
@ -6,6 +7,7 @@ namespace Bootstrap.Client.Controllers.Api
|
|||
/// 运维管理接口
|
||||
/// </summary>
|
||||
[Route("api/[controller]")]
|
||||
[Authorize]
|
||||
[ApiController]
|
||||
public class AdminController : ControllerBase
|
||||
{
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using Bootstrap.Client.Models;
|
||||
using Bootstrap.Client.Tasks;
|
||||
using Longbow.Configuration;
|
||||
using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
||||
|
@ -13,6 +12,7 @@ namespace Bootstrap.Client.Controllers
|
|||
/// <summary>
|
||||
/// 前台主页控制器
|
||||
/// </summary>
|
||||
[Authorize]
|
||||
public class HomeController : Controller
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -91,10 +91,7 @@ namespace Bootstrap.Client
|
|||
app.UseAuthorization();
|
||||
app.UseCacheManager();
|
||||
app.UseOnlineUsers(callback: TraceHelper.Save);
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapDefaultControllerRoute().RequireAuthorization();
|
||||
});
|
||||
app.UseEndpoints(endpoints => endpoints.MapDefaultControllerRoute());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue