直播平台搭建,实现自定义设置登录页面
1.在resources中建立static文件夹(默认找这里面的页面)
创建login.html
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>static中的login</title>
</head>
<body>
<form action="/user/login" method="post">
用户名:<input type="text" name="username"/>
<br/>
密码:<input type="text" name="password"/>
<br/>
<input type="submit" value="login"/>
</form>
</body>
</html>
注意:其中username和password是固定的
但是是可以自定义的,但是在这里使用默认的
2.controller文件:
@RestController
@RequestMapping("/test")
public class TestController {
@GetMapping("hello")
public String add(){
return "hello security";
}
@GetMapping("index")
public String add2(){
return "hello index";
}
}
以上就是直播平台搭建,实现自定义设置登录页面, 更多内容欢迎关注之后的文章