using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc.Filters;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Threading.Tasks;
|
using VueWebCoreApi.Models;
|
|
namespace VueWebCoreApi.Tools
|
{
|
public class ChannelActionFilterAttributeApp : ActionFilterAttribute
|
{
|
ToMessage mes = new ToMessage();
|
RedisCommon redis = new RedisCommon();
|
|
/// <summary>
|
/// 在Action执行前执行
|
/// </summary>
|
/// <param name="context"></param>
|
public override void OnActionExecuting(ActionExecutingContext context)
|
{
|
try
|
{
|
|
mes.code = "303";
|
mes.message = "登录已超时,请重新登录!";
|
context.Result = new JsonResult(mes);
|
|
}
|
catch (Exception)
|
{
|
mes.code = "303";
|
mes.message = "登录已超时,请重新登录!";
|
context.Result = new JsonResult(mes);
|
}
|
}
|
}
|
}
|