mstp_22_developr.mvc/Controllers/BaseController.cs

(完整代码) 850B

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using mstp_22_developr.mvc.Models;

namespace mstp_22_developr.mvc.Controllers
{
    public class BaseController : Controller
    {
        protected override void OnActionExecuted(System.Web.Mvc.ActionExecutedContext filterContext)
        {
            base.OnActionExecuted(filterContext);
            if (WebSingleton.Singleton.CurrentUser == null || String.IsNullOrEmpty(WebSingleton.Singleton.CurrentUser.Id))
            {
                //string url = "http://" + HttpContext.Request.Url.Authority + @"/Account/Index";
                //filterContext.Result = new RedirectResult(url);
                Response.Write("<script>top.location.href='/Account/Index'</script>");
            }

        }

    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。