// // // using ERP.Framework.Constants; using ERP.Framework.Security; using Microsoft.AspNetCore.Mvc.Filters; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ERP.Framework.Attribute { /// /// 接口权限特性 /// [AttributeUsage(AttributeTargets.Method)] public class PermissionAttribute : ActionFilterAttribute { //internal string Code { get; set; } //public PermissionAttribute(string code) //{ // Code = code; //} //public override void OnActionExecuted(ActionExecutedContext context) //{ // var loginUser = LoginHelper.GetLoginUser(); // if (loginUser.Permission.Contains(FrameworkConstant.AdminPermission)) // { // return; // } // if (!loginUser.Permission.Contains(this.Code)) // { // throw new Exception(AuthI18N.NoPermission); // } //} } }