21 lines
517 B
C#
Executable File
21 lines
517 B
C#
Executable File
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", "");
|
|
}
|
|
}
|
|
} |