mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-10-21 11:07:23 +08:00
v1.15.0.RELEASE 发布
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>cn.dev33</groupId>
|
||||
<artifactId>sa-token-parent</artifactId>
|
||||
<version>1.15.0</version>
|
||||
<version>1.15.0.RELEASE</version>
|
||||
</parent>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
|
@@ -15,13 +15,19 @@ import cn.dev33.satoken.stp.StpUtil;
|
||||
public class SaRouteInterceptor implements HandlerInterceptor {
|
||||
|
||||
/**
|
||||
* 自定义模式下的执行函数
|
||||
* 每次进入拦截器的[执行函数]
|
||||
*/
|
||||
public SaRouteFunction function;
|
||||
|
||||
/**
|
||||
* 创建 (默认为自定义认证)
|
||||
* @param function 自定义模式下的执行函数
|
||||
* 创建一个路由拦截器
|
||||
*/
|
||||
public SaRouteInterceptor() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建, 并指定[执行函数]
|
||||
* @param function [执行函数]
|
||||
*/
|
||||
public SaRouteInterceptor(SaRouteFunction function) {
|
||||
this.function = function;
|
||||
@@ -50,6 +56,7 @@ public class SaRouteInterceptor implements HandlerInterceptor {
|
||||
if(function == null) {
|
||||
StpUtil.checkLogin();
|
||||
} else {
|
||||
// 否则执行函数
|
||||
function.run(request, response, handler);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user