Files
Web_F305_Mqtt_Prod/MQTTServerSideAPI/Controllers/BaseController.cs
2025-11-26 11:32:30 +08:00

42 lines
1.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using Newtonsoft.Json;
using Org.BouncyCastle.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace MQTTServerSideAPI.Controllers
{
public class BaseController : Controller
{
/// <summary>
/// 在Action方法调用前使用使用场景如何验证登录等。
/// </summary>
/// <param name="filterContext"></param>
protected override void OnActionExecuting(ActionExecutingContext filterContext)
{
try
{
base.OnActionExecuting(filterContext);
if (Session["username"] == null)
{
filterContext.Result = new RedirectResult("/LoginViews/Index");
}
else
{
}
}
catch (Exception ex)
{
Logger.LogCalloutanaSide("Session:__________________" + ex);
}
}
}
}