摘要: 通过配置文件配置 spring.security.user.name=javaboy spring.security.user.password=1234 # 角色: 支持数组 spring.security.user.roles=admin 配置完毕,再次启动项目,访问 /hello 一样的输入用 阅读全文
posted @ 2020-05-13 22:50 Leader_TBlog 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 创建工程 选择依赖 这里只需要引入上面两个依赖即可, next 重点: 只要加入了 Security 的依赖,项目中的所有接口统统被保护起来了! @RestController public class HelloController { @GetMapping("/hello") public S 阅读全文
posted @ 2020-05-13 22:15 Leader_TBlog 阅读(117) 评论(0) 推荐(0) 编辑