类 SaRouter
java.lang.Object
cn.dev33.satoken.router.SaRouter
路由匹配操作工具类
- 作者:
- kong
-
方法概要
修饰符和类型方法说明static SaRouterStaffback()停止匹配,结束执行,向前端返回结果static SaRouterStaff停止匹配,结束执行,向前端返回结果static booleanisMatch(SaHttpMethod[] methods, String methodString) Http请求方法匹配static boolean路由匹配static boolean路由匹配static boolean路由匹配static booleanisMatchCurrMethod(SaHttpMethod[] methods) Http请求方法匹配 (使用当前请求方式)static booleanisMatchCurrURI(String pattern) 路由匹配 (使用当前URI)static booleanisMatchCurrURI(String[] patterns) 路由匹配 (使用当前URI)static booleanisMatchCurrURI(List<String> patterns) 路由匹配 (使用当前URI)static SaRouterStaffmatch(boolean flag) 根据 boolean 值进行匹配static SaRouterStaffmatch(SaParamRetFunction<Object, Boolean> fun) 根据自定义方法进行匹配 (lazy)static SaRouterStaffmatch(SaHttpMethod... methods) Http请求方式匹配 (Enum)static SaRouterStaff路由匹配static SaRouterStaffmatch(String pattern, SaFunction fun) 路由匹配,如果匹配成功则执行认证函数static SaRouterStaffmatch(String pattern, SaParamFunction<SaRouterStaff> fun) 路由匹配,如果匹配成功则执行认证函数static SaRouterStaffmatch(String pattern, String excludePattern, SaFunction fun) 路由匹配 (并指定排除匹配符),如果匹配成功则执行认证函数static SaRouterStaffmatch(String pattern, String excludePattern, SaParamFunction<SaRouterStaff> fun) 路由匹配 (并指定排除匹配符),如果匹配成功则执行认证函数static SaRouterStaff路由匹配static SaRouterStaffmatchMethod(String... methods) Http请求方法匹配 (String)static SaRouterStaffnewMatch()初始化一个SaRouterStaff,开始匹配static SaRouterStaffnotMatch(boolean flag) 根据 boolean 值进行匹配排除static SaRouterStaff根据自定义方法进行匹配排除 (lazy)static SaRouterStaffnotMatch(SaHttpMethod... methods) Http请求方法匹配排除 (Enum)static SaRouterStaff路由匹配排除static SaRouterStaff路由匹配排除static SaRouterStaffnotMatchMethod(String... methods) Http请求方法匹配排除 (String)static SaRouterStaffstop()停止匹配,跳出函数 (在多个匹配链中一次性跳出Auth函数)
-
方法详细资料
-
isMatch
路由匹配- 参数:
pattern- 路由匹配符path- 被匹配的路由- 返回:
- 是否匹配成功
-
isMatch
路由匹配- 参数:
patterns- 路由匹配符集合path- 被匹配的路由- 返回:
- 是否匹配成功
-
isMatch
路由匹配- 参数:
patterns- 路由匹配符数组path- 被匹配的路由- 返回:
- 是否匹配成功
-
isMatch
Http请求方法匹配- 参数:
methods- Http请求方法断言数组methodString- Http请求方法- 返回:
- 是否匹配成功
-
isMatchCurrURI
路由匹配 (使用当前URI)- 参数:
pattern- 路由匹配符- 返回:
- 是否匹配成功
-
isMatchCurrURI
路由匹配 (使用当前URI)- 参数:
patterns- 路由匹配符集合- 返回:
- 是否匹配成功
-
isMatchCurrURI
路由匹配 (使用当前URI)- 参数:
patterns- 路由匹配符数组- 返回:
- 是否匹配成功
-
isMatchCurrMethod
Http请求方法匹配 (使用当前请求方式)- 参数:
methods- Http请求方法断言数组- 返回:
- 是否匹配成功
-
newMatch
初始化一个SaRouterStaff,开始匹配- 返回:
- SaRouterStaff
-
match
路由匹配- 参数:
patterns- 路由匹配符集合- 返回:
- SaRouterStaff
-
notMatch
路由匹配排除- 参数:
patterns- 路由匹配符排除数组- 返回:
- SaRouterStaff
-
match
路由匹配- 参数:
patterns- 路由匹配符集合- 返回:
- 对象自身
-
notMatch
路由匹配排除- 参数:
patterns- 路由匹配符排除集合- 返回:
- 对象自身
-
match
Http请求方式匹配 (Enum)- 参数:
methods- Http请求方法断言数组- 返回:
- SaRouterStaff
-
notMatch
Http请求方法匹配排除 (Enum)- 参数:
methods- Http请求方法断言排除数组- 返回:
- SaRouterStaff
-
matchMethod
Http请求方法匹配 (String)- 参数:
methods- Http请求方法断言数组- 返回:
- SaRouterStaff
-
notMatchMethod
Http请求方法匹配排除 (String)- 参数:
methods- Http请求方法断言排除数组- 返回:
- SaRouterStaff
-
match
根据 boolean 值进行匹配- 参数:
flag- boolean值- 返回:
- SaRouterStaff
-
notMatch
根据 boolean 值进行匹配排除- 参数:
flag- boolean值- 返回:
- SaRouterStaff
-
match
根据自定义方法进行匹配 (lazy)- 参数:
fun- 自定义方法- 返回:
- SaRouterStaff
-
notMatch
根据自定义方法进行匹配排除 (lazy)- 参数:
fun- 自定义排除方法- 返回:
- SaRouterStaff
-
match
路由匹配,如果匹配成功则执行认证函数- 参数:
pattern- 路由匹配符fun- 要执行的校验方法- 返回:
- /
-
match
路由匹配,如果匹配成功则执行认证函数- 参数:
pattern- 路由匹配符fun- 要执行的校验方法- 返回:
- /
-
match
路由匹配 (并指定排除匹配符),如果匹配成功则执行认证函数- 参数:
pattern- 路由匹配符excludePattern- 要排除的路由匹配符fun- 要执行的方法- 返回:
- /
-
match
public static SaRouterStaff match(String pattern, String excludePattern, SaParamFunction<SaRouterStaff> fun) 路由匹配 (并指定排除匹配符),如果匹配成功则执行认证函数- 参数:
pattern- 路由匹配符excludePattern- 要排除的路由匹配符fun- 要执行的方法- 返回:
- /
-
stop
停止匹配,跳出函数 (在多个匹配链中一次性跳出Auth函数)- 返回:
- SaRouterStaff
-
back
停止匹配,结束执行,向前端返回结果- 返回:
- SaRouterStaff
-
back
停止匹配,结束执行,向前端返回结果- 参数:
result- 要输出的结果- 返回:
- SaRouterStaff
-