接口如:
public IList<string> TestAOP(string token);


public IMethodReturn Invoke(IMethodInvocation input, GetNextInterceptionBehaviorDelegate getNext) { /*验证token的账户是否已登陆 *2014年11月12日 14:01:32 */ if (input.Arguments.ContainsParameter("token")) { var tokenValue = input.Arguments["token"].ToString(); //存在token值则验证(目前还存在前端未传情况 空值token 跳过) if (!string.IsNullOrWhiteSpace(tokenValue)) { if (!ExistsUserLogin(tokenValue).IsLogin) { IMethodReturn mr = new VirtualMethodReturn(input, null); //创建返回对象 var methodInfo = input.MethodBase as MethodInfo; mr.ReturnValue = Activator.CreateInstance(methodInfo.ReturnType); //获取当前接口的返回类型并得到初始化实例填充到 返回对象里 return mr; } } }

        return getNext().Invoke(input, getNext);
    }

  

 

相关文章:

  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2021-06-04
  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
  • 2022-12-23
猜你喜欢
  • 2022-01-08
  • 2022-12-23
  • 2022-03-05
  • 2021-07-11
  • 2021-07-27
相关资源
相似解决方案