摘要: Security方法安全 配置类中开启 添加注解 @EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true) 编写方法 /** * @title: MethodService * @projectName spr 阅读全文
posted @ 2020-05-19 22:11 Leader_TBlog 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Security密码加密 密码加密 在单元测试中 使用循环生成 10次不同的 密文,在Security中 有一个 BCryptPasswordEncoder 密码加密的工具 @Test void contextLoads() { BCryptPasswordEncoder encoder = new 阅读全文
posted @ 2020-05-19 21:54 Leader_TBlog 阅读(826) 评论(0) 推荐(0) 编辑
摘要: 创建一个配置类 /** * @title: MultiSecurityConfig * @projectName springsecurity * @描述: TODO * @作者: 小灰灰 * @创建时间 2020-05-1920:16 */ @Configuration public class 阅读全文
posted @ 2020-05-19 21:18 Leader_TBlog 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 重写 HttpSecurity @Override protected void configure(HttpSecurity http) throws Exception { // 开启配置 http.authorizeRequests() // 访问路径以: /admin/开头的 需要具备哪些角 阅读全文
posted @ 2020-05-19 21:17 Leader_TBlog 阅读(178) 评论(0) 推荐(0) 编辑