springboot-sample
介绍
springboot简单示例 跳转到发行版
软件架构(当前发行版)
- Springboot3.1.3
安装教程
git clone --branch 基本登录验证 git@gitee.com:simen_net/springboot-sample.git
主要功能
增加登录验证功能
- 在pom.xml中加入
spring-boot-starter - 增加验证配置类WebSecurityConfig.java,配置用户密码、登录接口等
- SystemController.java中增加
@GetMapping("/login")返回到登录界面模板文件login.ftl - SystemController.java中定义的
@RequestMapping("/getPerson")增加了@PreAuthorize("hasAuthority('file_write')")权限限制
- 在pom.xml中加入
功能演示
- http://localhost:8080/index.html 无需验证
- 访问其他页面,自动跳转到 http://localhost:8080/login.html ,按照页面上提示,分别使用simen和admin用户登录测试访问权限