类 SaInterceptor

java.lang.Object
cn.dev33.satoken.loveqq.boot.interceptor.SaInterceptor
所有已实现的接口:
com.kfyty.loveqq.framework.web.core.interceptor.HandlerInterceptor

public class SaInterceptor extends Object implements com.kfyty.loveqq.framework.web.core.interceptor.HandlerInterceptor
Sa-Token 综合拦截器,提供注解鉴权和路由拦截鉴权能力
从以下版本开始:
1.31.0
作者:
click33
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    cn.dev33.satoken.fun.SaParamFunction<Object>
    认证函数:每次请求执行
    cn.dev33.satoken.fun.SaParamFunction<Object>
    认证前置函数:在注解鉴权之前执行
    boolean
    是否打开注解鉴权,配置为 true 时注解鉴权才会生效,配置为 false 时,即使写了注解也不会进行鉴权
  • 构造器概要

    构造器
    构造器
    说明
    创建一个 Sa-Token 综合拦截器,默认带有注解鉴权能力
    SaInterceptor(cn.dev33.satoken.fun.SaParamFunction<Object> auth)
    创建一个 Sa-Token 综合拦截器,默认带有注解鉴权能力
  • 方法概要

    修饰符和类型
    方法
    说明
    isAnnotation(boolean isAnnotation)
    设置是否打开注解鉴权:配置为 true 时注解鉴权才会生效,配置为 false 时,即使写了注解也不会进行鉴权
    boolean
    preHandle(com.kfyty.loveqq.framework.web.core.http.ServerRequest request, com.kfyty.loveqq.framework.web.core.http.ServerResponse response, com.kfyty.loveqq.framework.web.core.mapping.MethodMapping handler)
    每次请求之前触发的方法
    setAuth(cn.dev33.satoken.fun.SaParamFunction<Object> auth)
    写入 [ 认证函数 ]: 每次请求执行
    setBeforeAuth(cn.dev33.satoken.fun.SaParamFunction<Object> beforeAuth)
    写入 [ 认证前置函数 ]: 在注解鉴权之前执行

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    从接口继承的方法 com.kfyty.loveqq.framework.web.core.interceptor.HandlerInterceptor

    afterCompletion, excludes, includes, postHandle
  • 字段详细资料

    • isAnnotation

      public boolean isAnnotation
      是否打开注解鉴权,配置为 true 时注解鉴权才会生效,配置为 false 时,即使写了注解也不会进行鉴权
    • beforeAuth

      public cn.dev33.satoken.fun.SaParamFunction<Object> beforeAuth
      认证前置函数:在注解鉴权之前执行

      参数:路由处理函数指针

    • auth

      public cn.dev33.satoken.fun.SaParamFunction<Object> auth
      认证函数:每次请求执行

      参数:路由处理函数指针

  • 构造器详细资料

    • SaInterceptor

      public SaInterceptor()
      创建一个 Sa-Token 综合拦截器,默认带有注解鉴权能力
    • SaInterceptor

      public SaInterceptor(cn.dev33.satoken.fun.SaParamFunction<Object> auth)
      创建一个 Sa-Token 综合拦截器,默认带有注解鉴权能力
      参数:
      auth - 认证函数,每次请求执行
  • 方法详细资料

    • isAnnotation

      public SaInterceptor isAnnotation(boolean isAnnotation)
      设置是否打开注解鉴权:配置为 true 时注解鉴权才会生效,配置为 false 时,即使写了注解也不会进行鉴权
      参数:
      isAnnotation - /
      返回:
      对象自身
    • setBeforeAuth

      public SaInterceptor setBeforeAuth(cn.dev33.satoken.fun.SaParamFunction<Object> beforeAuth)
      写入 [ 认证前置函数 ]: 在注解鉴权之前执行
      参数:
      beforeAuth - /
      返回:
      对象自身
    • setAuth

      public SaInterceptor setAuth(cn.dev33.satoken.fun.SaParamFunction<Object> auth)
      写入 [ 认证函数 ]: 每次请求执行
      参数:
      auth - /
      返回:
      对象自身
    • preHandle

      public boolean preHandle(com.kfyty.loveqq.framework.web.core.http.ServerRequest request, com.kfyty.loveqq.framework.web.core.http.ServerResponse response, com.kfyty.loveqq.framework.web.core.mapping.MethodMapping handler)
      每次请求之前触发的方法
      指定者:
      preHandle 在接口中 com.kfyty.loveqq.framework.web.core.interceptor.HandlerInterceptor