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