public class SaInterceptor extends Object implements org.springframework.web.servlet.HandlerInterceptor
| Modifier and Type | Field and Description |
|---|---|
boolean |
isAnnotation
是否打开注解鉴权,配置为 true 时注解鉴权才会生效,配置为 false 时,即使写了注解也不会进行鉴权
|
| Constructor and Description |
|---|
SaInterceptor()
创建一个 Sa-Token 综合拦截器,默认带有注解鉴权能力
|
| Modifier and Type | Method and Description |
|---|---|
SaInterceptor |
isAnnotation(boolean isAnnotation)
设置是否打开注解鉴权:配置为 true 时注解鉴权才会生效,配置为 false 时,即使写了注解也不会进行鉴权
|
boolean |
preHandle(@NotNull javax.servlet.http.HttpServletRequest request,
@NotNull javax.servlet.http.HttpServletResponse response,
@NotNull Object handler)
每次请求之前触发的方法
|
public boolean isAnnotation
public SaInterceptor isAnnotation(boolean isAnnotation)
isAnnotation - /public boolean preHandle(@NotNull
@NotNull javax.servlet.http.HttpServletRequest request,
@NotNull
@NotNull javax.servlet.http.HttpServletResponse response,
@NotNull
@NotNull Object handler)
throws Exception
preHandle in interface org.springframework.web.servlet.HandlerInterceptorExceptionCopyright © 2024. All rights reserved.