JXMovies/Core/JXCMS.Core/Auth/BaseAuthorizeAttribute.cs

21 lines
517 B
C#
Raw Permalink Normal View History

2020-02-09 19:10:05 +08:00
using Microsoft.AspNetCore.Authorization;
namespace JXCMS.Core.Auth
{
public abstract class BaseAuthorizeAttribute : AuthorizeAttribute
{
public static string LoginPath = "/Admin/Login";
public static string AccessDeniedPath = "/Error/Forbidden";
public BaseAuthorizeAttribute()
{
AuthenticationSchemes = GetScheme();
}
public string GetScheme()
{
return GetType().Name.Replace("AuthorizeAttribute", "");
}
}
}