类 SaInterceptor
java.lang.Object
cn.sinozg.applet.common.sa.SaInterceptor
- 所有已实现的接口:
org.springframework.web.servlet.HandlerInterceptor
public class SaInterceptor
extends Object
implements org.springframework.web.servlet.HandlerInterceptor
Sa-Token 综合拦截器,提供注解鉴权和路由拦截鉴权能力
重写,保证可以拿到具体异常 由全局异常处理器去处理所有的异常
- 从以下版本开始:
- 1.31.0
- 作者:
- click33
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明isAnnotation(boolean isAnnotation) 设置是否打开注解鉴权:配置为 true 时注解鉴权才会生效,配置为 false 时,即使写了注解也不会进行鉴权booleanpreHandle(@NotNull jakarta.servlet.http.HttpServletRequest request, @NotNull jakarta.servlet.http.HttpServletResponse response, @NotNull Object handler) 每次请求之前触发的方法从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 org.springframework.web.servlet.HandlerInterceptor
afterCompletion, postHandle
-
字段详细资料
-
isAnnotation
public boolean isAnnotation是否打开注解鉴权,配置为 true 时注解鉴权才会生效,配置为 false 时,即使写了注解也不会进行鉴权
-
-
构造器详细资料
-
SaInterceptor
public SaInterceptor()创建一个 Sa-Token 综合拦截器,默认带有注解鉴权能力
-
-
方法详细资料
-
isAnnotation
设置是否打开注解鉴权:配置为 true 时注解鉴权才会生效,配置为 false 时,即使写了注解也不会进行鉴权- 参数:
isAnnotation- /- 返回:
- 对象自身
-
preHandle
public boolean preHandle(@NotNull @NotNull jakarta.servlet.http.HttpServletRequest request, @NotNull @NotNull jakarta.servlet.http.HttpServletResponse response, @NotNull @NotNull Object handler) throws Exception 每次请求之前触发的方法- 指定者:
preHandle在接口中org.springframework.web.servlet.HandlerInterceptor- 抛出:
Exception
-