Interface SaFilter


public interface SaFilter
Sa-Token 过滤器接口,为不同版本的过滤器: 1、封装共同代码。 2、定义统一的行为接口。
Since:
1.34.0
Author:
click33
  • Method Details

    • addInclude

      SaFilter addInclude(String... paths)
      添加 [ 拦截路由 ]
      Parameters:
      paths - 路由
      Returns:
      对象自身
    • addExclude

      SaFilter addExclude(String... paths)
      添加 [ 放行路由 ]
      Parameters:
      paths - 路由
      Returns:
      对象自身
    • setIncludeList

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

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

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

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

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