第二次提交

This commit is contained in:
zyx 2024-09-05 10:16:49 +08:00
parent d9176489dc
commit 1d1b7c703a
6 changed files with 85 additions and 0 deletions

View File

@ -0,0 +1,23 @@
package com.zyx.springboot.springboot.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class loginController {
@RequestMapping("login")
public String login(){
return "login.html";
}
@RequestMapping("logincommit")
public String logincommit(String username,String password){
if(username.equals("admin")&&password.equals("123456"))
{
return "loginSucess.html";
}
return "loginFail.html";
}
}

View File

@ -0,0 +1,13 @@
package com.zyx.springboot.springboot.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class newsController {
@RequestMapping("news")
public String news(){
return "news.html";
}
}

View File

@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<h1> 登陆页面 </h1>
<form th:action="@{/logincommit}" method="post">
<input type="text" name="username" placeholder="用户名"><br/>
<input type="password" name="password" placeholder="密码"><br/>
<input type="submit" value="登陆"></input>
</input>
</form>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>登陆失败</title>
</head>
<body>
</body>
</html>

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>登陆成功</title>
</head>
<body>
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<h1>新闻页面············</h1>
<div th:text="${newsid}"></div>
<div th:src="${123.png}"></div>
</body>
</html>