This commit is contained in:
张良(004796)
2023-12-20 21:40:09 +08:00
parent a3d488ac73
commit 346fbb494e
242 changed files with 388 additions and 41827 deletions

View File

@@ -41,21 +41,9 @@ public class SaTokenConfig implements WebMvcConfigurer {
AllUrlHandler allUrlHandler = SpringUtils.getBean(AllUrlHandler.class);
// 登录验证 -- 排除多个路径
SaRouter
// 获取所有的
.match(allUrlHandler.getUrls())
// 对未排除的路径进行检查
.check(() -> {
// 检查是否登录 是否有token
StpUtil.checkLogin();
// 有效率影响 用于临时测试
// if (log.isDebugEnabled()) {
// log.info("剩余有效时间: {}", StpUtil.getTokenTimeout());
// log.info("临时有效时间: {}", StpUtil.getTokenActiveTimeout());
// }
});
})).addPathPatterns("/**")
.check(() -> StpUtil.checkLogin());
})).addPathPatterns("/**")
// 排除不需要拦截的路径
.excludePathPatterns(securityProperties.getExcludes());
}

View File

@@ -25,7 +25,6 @@ public class SaPermissionImpl implements StpInterface {
if (userType == UserType.SYS_USER) {
return new ArrayList<>(loginUser.getMenuPermission());
} else if (userType == UserType.APP_USER) {
// 其他端 自行根据业务编写
}
return new ArrayList<>();
}
@@ -40,7 +39,6 @@ public class SaPermissionImpl implements StpInterface {
if (userType == UserType.SYS_USER) {
return new ArrayList<>(loginUser.getRolePermission());
} else if (userType == UserType.APP_USER) {
// 其他端 自行根据业务编写
}
return new ArrayList<>();
}