接口 SaFilter


public interface SaFilter
Sa-Token 过滤器接口,为不同版本的过滤器: 1、封装共同代码。 2、定义统一的行为接口。
从以下版本开始:
1.34.0
作者:
click33
  • 方法详细资料

    • addInclude

      SaFilter addInclude(String... paths)
      添加 [ 拦截路由 ]
      参数:
      paths - 路由
      返回:
      对象自身
    • addExclude

      SaFilter addExclude(String... paths)
      添加 [ 放行路由 ]
      参数:
      paths - 路由
      返回:
      对象自身
    • setIncludeList

      SaFilter setIncludeList(List<String> pathList)
      写入 [ 拦截路由 ] 集合
      参数:
      pathList - 路由集合
      返回:
      对象自身
    • setExcludeList

      SaFilter setExcludeList(List<String> pathList)
      写入 [ 放行路由 ] 集合
      参数:
      pathList - 路由集合
      返回:
      对象自身
    • setAuth

      写入[ 认证函数 ]: 每次请求执行
      参数:
      auth - see note
      返回:
      对象自身
    • setError

      写入[ 异常处理函数 ]:每次[ 认证函数 ]发生异常时执行此函数
      参数:
      error - see note
      返回:
      对象自身
    • setBeforeAuth

      SaFilter setBeforeAuth(SaFilterAuthStrategy beforeAuth)
      写入[ 前置函数 ]:在每次[ 认证函数 ]之前执行。 注意点:前置认证函数将不受 includeList 与 excludeList 的限制,所有路由的请求都会进入 beforeAuth
      参数:
      beforeAuth - /
      返回:
      对象自身