We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.39.0
我想在SaInterceptor中对越权访问的用户记录日志,但是代码好像没有生效。
对越权访问的用户记录日志
@OverRide public void addInterceptors(InterceptorRegistry registry) { // 注册 Sa-Token 拦截器,打开注解式鉴权功能 registry.addInterceptor(new SaInterceptor(handle -> { Object loginId = StpUtil.getLoginId(); log.info("loginId is {}", loginId); try { Account account = accountService.findById((String) loginId); String role = account.getRoleType().name();
SaRouter.match("/**").check(r -> { StpUtil.checkRole(role); }); } catch (NotRoleException | CommonException e){ log.info("not role exception."); } })).addPathPatterns("/**");
}
< 备注:如果复现步骤比较复杂,请将 demo 上传到 gitee 并留下地址 >
The text was updated successfully, but these errors were encountered:
No branches or pull requests
使用版本:
1.39.0
报错信息:
我想在SaInterceptor中对越权访问的用户记录日志,但是代码好像没有生效。
希望结果:
对越权访问的用户记录日志
复现步骤:
@OverRide
public void addInterceptors(InterceptorRegistry registry) {
// 注册 Sa-Token 拦截器,打开注解式鉴权功能
registry.addInterceptor(new SaInterceptor(handle -> {
Object loginId = StpUtil.getLoginId();
log.info("loginId is {}", loginId);
try {
Account account = accountService.findById((String) loginId);
String role = account.getRoleType().name();
}
< 备注:如果复现步骤比较复杂,请将 demo 上传到 gitee 并留下地址 >
The text was updated successfully, but these errors were encountered: