初始化项目

This commit is contained in:
2025-11-20 13:11:05 +08:00
commit d5edc62c08
2412 changed files with 2201918 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
namespace AUTS.Web
{
public class HandlerAuthorizeAttribute : ActionFilterAttribute
{
public bool Ignore { get; set; }
public HandlerAuthorizeAttribute(bool ignore = true)
{
Ignore = ignore;
}
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
var model = Services.UserLoginHelper.CurrentUser();
if (!(model.IsAdmin))
{
//StringBuilder sbScript = new StringBuilder();
//sbScript.Append("<script type='text/javascript'>alert('很抱歉!您的权限不足,访问被拒绝!');</script>");
//filterContext.Result = new ContentResult() { Content = sbScript.ToString() };
filterContext.Result = new RedirectToRouteResult(new RouteValueDictionary(new
{
controller = "Home",
action = "NoAuthority"
}));
return;
}
}
}
}