- 一个简单的前端登陆界面
<!DOCTYPE html> <html lang="en" xmlns:th="http://www.thymeleaf.org"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <!--th:action 提交到 Security配置中的 loginProcessingUrl("/login.do")方法--> <form method="post" th:action="@{/login.do}"> 用户名:<input th:name="username" type="text"><br> 密 码:<input th:name="password" type="password"><br> <input type="submit" value="登陆"> </form> </body> </html>
- Secrity 配置类
package com.yang.config; import com.yang.service.UserLoginDetailsService; import com.yang.utils.Constants; import org.springframework.beans.factory.annotation.Autowired; import org.spring
Spring Security 实现数据库登陆判断以及主界面获取用户名
最新推荐文章于 2022-10-28 11:13:27 发布