可以前往第一篇博客查看目录结构 --> 这里
一、查看是否依赖Spring Security相关jar包(例如: spring-boot-starter-security) ,修改demo模块下的 application.propertiies(打开spring security认证)
//注释掉这段配置,开启springsecurity
#security.basic.enabled=false
二、编写简单的html登录页面,放在browser模块下的 src -> main -> resources -> resources -> zeke-login.html
(表单提交地址是:/authentication/form 待会需要用到)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Login Page</title>
</head>
<body>
<form action="/authentication/form" method="post">
<table>
<tr>
<td>用户名:</td>
<td><input type="text" name="username"/></td>
</tr>
<tr>
<td>密码:</td>
<td><input type="password" name="password"/></td>
</tr>
<tr>
<td colspan="2"><button type="submit">登录</button></td>
</tr>
</table>
</form>
</body>
</html>
三、在browser模块 src->main->java->com->zeke->browser新建support目录,创建简单的返回值类
public class SimpleResponse {
private Object content;
public SimpleResponse(Object content) {
this.content = content;
}
public Object getContent() {
return co