2022年6月11日

Spring Security - 退出

摘要: 阅读全文

posted @ 2022-06-11 22:16 每天积极向上 阅读(32) 评论(0) 推荐(0)

Spring Security - 权限注解

摘要: 开启: @EnableGlobalMethodSecurity(securedEnabled = true) 注解 使用场景:控制类中的方法上 作用:有该角色或权限时,可以执行 否则不能执行 会抛出异常 角色:@Secured({"ROLE_role1","ROLE_role2"}) 权限:@Pre 阅读全文

posted @ 2022-06-11 22:11 每天积极向上 阅读(525) 评论(0) 推荐(0)

Spring Security - 权限与角色

摘要: 配置类: /* * Security配置类 * 要实现WebSecurityConfigurerAdapter抽象类 * */ @Configuration public class SecurityConfig extends WebSecurityConfigurerAdapter { //用户 阅读全文

posted @ 2022-06-11 21:48 每天积极向上 阅读(381) 评论(0) 推荐(0)

Spring Security - 重写认证(登录)

摘要: bean: LeUser.java @Data public class LeUser { private String userId; private String userName; private String userPassword; } LeUserDetails.java @Data 阅读全文

posted @ 2022-06-11 19:21 每天积极向上 阅读(2010) 评论(0) 推荐(0)

导航