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 @@ + + +
+ +