mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
完善配置
This commit is contained in:
@@ -14,6 +14,7 @@ import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.SneakyThrows;
|
||||
import org.apache.commons.lang3.BooleanUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.slf4j.MDC;
|
||||
@@ -132,7 +133,8 @@ public class AuthFilter extends OncePerRequestFilter {
|
||||
.filter(x -> StringUtils.equals(x.getId(), resource.get().getId())).findAny();
|
||||
|
||||
|
||||
if (userResource.isEmpty() && !user.getSysAdmin()) {
|
||||
if (userResource.isEmpty() && BooleanUtils.isFalse(user.getSysAdmin())) {
|
||||
|
||||
writeResponse(new BizException("invalidAccess", "当前资源未授权,请联系机构管理员处理。"), response);
|
||||
} else {
|
||||
|
||||
|
||||
@@ -27,6 +27,8 @@ public class SecurityConfig {
|
||||
|
||||
})
|
||||
.csrf(AbstractHttpConfigurer::disable)
|
||||
.logout(AbstractHttpConfigurer::disable)
|
||||
.formLogin(AbstractHttpConfigurer::disable)
|
||||
.build();
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user