From 1d1b7c703a1f5408ad5e1ad160022442bfcfe541 Mon Sep 17 00:00:00 2001 From: zyx <1921524946@qq.com> Date: Thu, 5 Sep 2024 10:16:49 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E6=AC=A1=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/loginController.java | 23 +++++++++++++++++++ .../springboot/controller/newsController.java | 13 +++++++++++ .../src/main/resources/templates/login.html | 16 +++++++++++++ .../main/resources/templates/loginFail.html | 10 ++++++++ .../main/resources/templates/loginSucess.html | 10 ++++++++ .../src/main/resources/templates/news.html | 13 +++++++++++ 6 files changed, 85 insertions(+) create mode 100644 springboot/src/main/java/com/zyx/springboot/springboot/controller/loginController.java create mode 100644 springboot/src/main/java/com/zyx/springboot/springboot/controller/newsController.java create mode 100644 springboot/src/main/resources/templates/login.html create mode 100644 springboot/src/main/resources/templates/loginFail.html create mode 100644 springboot/src/main/resources/templates/loginSucess.html create mode 100644 springboot/src/main/resources/templates/news.html diff --git a/springboot/src/main/java/com/zyx/springboot/springboot/controller/loginController.java b/springboot/src/main/java/com/zyx/springboot/springboot/controller/loginController.java new file mode 100644 index 0000000..fea27b3 --- /dev/null +++ b/springboot/src/main/java/com/zyx/springboot/springboot/controller/loginController.java @@ -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"; + } +} diff --git a/springboot/src/main/java/com/zyx/springboot/springboot/controller/newsController.java b/springboot/src/main/java/com/zyx/springboot/springboot/controller/newsController.java new file mode 100644 index 0000000..269d04f --- /dev/null +++ b/springboot/src/main/java/com/zyx/springboot/springboot/controller/newsController.java @@ -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"; + } +} diff --git a/springboot/src/main/resources/templates/login.html b/springboot/src/main/resources/templates/login.html new file mode 100644 index 0000000..e9ee8d6 --- /dev/null +++ b/springboot/src/main/resources/templates/login.html @@ -0,0 +1,16 @@ + + + + + Title + + +

登陆页面

+
+
+
+ + +
+ + \ No newline at end of file diff --git a/springboot/src/main/resources/templates/loginFail.html b/springboot/src/main/resources/templates/loginFail.html new file mode 100644 index 0000000..239e89a --- /dev/null +++ b/springboot/src/main/resources/templates/loginFail.html @@ -0,0 +1,10 @@ + + + + + 登陆失败 + + + + + \ No newline at end of file diff --git a/springboot/src/main/resources/templates/loginSucess.html b/springboot/src/main/resources/templates/loginSucess.html new file mode 100644 index 0000000..b7557e2 --- /dev/null +++ b/springboot/src/main/resources/templates/loginSucess.html @@ -0,0 +1,10 @@ + + + + + 登陆成功 + + + + + \ No newline at end of file diff --git a/springboot/src/main/resources/templates/news.html b/springboot/src/main/resources/templates/news.html new file mode 100644 index 0000000..d113614 --- /dev/null +++ b/springboot/src/main/resources/templates/news.html @@ -0,0 +1,13 @@ + + + + + Title + + +

新闻页面············

+
+
+ + + \ No newline at end of file