one , Project brief

function : houseparent , Top Administrator , Three identities of students , Including learning Student management , Dormitory administrator management , Attendance management , Dormitory building management , absence from duty Record management , Personal information modification and other functions .

two , Project operation

Environment configuration : Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ
IDEA,Eclispe,MyEclispe,Sts All support ).

Project technology : JSP + Entity+ Servlert + html+ css + JavaScript + JQuery + Ajax wait .

User login operation code :
User login operation : @Controller public class LoginController { @Autowired private
UserService userService; @Autowired private TeacherService teacherService;
@Autowired private StudentService studentService; // Jump to login page
@GetMapping("/login") public String login() { return "login"; } // Login operation
@PostMapping("/login") @ResponseBody public Map<String, Object> login(String
userName, String password, String captcha, String type, HttpSession session) {
// Judge user name , password , customer type , Is the verification code empty if (StringUtils.isEmpty(userName) ||
StringUtils.isEmpty(password) || StringUtils.isEmpty(captcha) ||
StringUtils.isEmpty(type)) { return
MapControl.getInstance().error(" User name or password cannot be empty ").getMap(); } // Get the verification code generated by the system String
_captcha = (String) session.getAttribute("captcha"); // First judge whether the verification code is correct if
(!(captcha.toLowerCase()).equals(_captcha.toLowerCase())) { // Verification code error return
MapControl.getInstance().error(" Verification code error ").getMap(); } // Judge user type if
("1".equals(type)) { // Administrator authentication login User user = userService.login(userName,
MD5Utils.getMD5(password)); // Encrypt the password , Because the encrypted password is stored in the database if (user != null) {
session.setAttribute("user", user); session.setAttribute("type", 1); return
MapControl.getInstance().success().add("data", user).getMap(); } else { return
MapControl.getInstance().error(" Wrong user name or password ").getMap(); } } if ("2".equals(type))
{ // Teacher authentication login Teacher teacher = teacherService.login(userName,
MD5Utils.getMD5(password)); if (teacher != null) { session.setAttribute("user",
teacher); session.setAttribute("type", "2"); return
MapControl.getInstance().success().add("data", teacher).getMap(); } else {
return MapControl.getInstance().error(" Wrong user name or password ").getMap(); } } if
("3".equals(type)) { // Student authentication login Student student = studentService.login(userName,
MD5Utils.getMD5(password)); if (student != null) { session.setAttribute("user",
student); session.setAttribute("type", "3"); return
MapControl.getInstance().success().add("data", student).getMap(); } else {
return MapControl.getInstance().error(" Wrong user name or password ").getMap(); } } return
MapControl.getInstance().getMap(); } }

User logout operation code :
User logout operation : @Controller public class LogoutController { // Exit operation
@RequestMapping("/logout") public String logout(HttpSession session) {
// Give Way session invalid session.invalidate(); // Redirect to login page return "redirect:login"; } }

Technology
©2019-2020 Toolsou All rights reserved,
Android Using wechat in H5 Payment result refresh during payment shock !!C++ Can make a sound ! Basic operation of single linked list C Language explanation Java Implement an epidemic number management system 2021 year 11 World programming language ranking linux upper mysql Invalid command _linux lower mysql The command is useless Java project : Campus dormitory management system (java+jsp+javaweb+mysql+ajax) Wechat applet development project directory linux ubuntu Which version ,Ubuntu Which version is the best ?python Code painting cherry blossoms - How to use Python Draw a beautiful cherry blossom