Spring MVC 4.3.2 + mybatis 3.4.1 + mysql 5.7.14 +shiro Kindergarten fee System Login

Source: Internet
Author: User

such as the title, with spring MVC 4.3.2+mybatis 3.4.1 + mysql 5.7.14 +shiro developed a management system for kindergartens.

Function module includes account, role, and rights management. Child file management, child charge management and so on. Permission to use the Shiro permission control, feeling is pretty strong. My idea is simple, good enough.

The front-end framework is developed based on the h-ui.admin template. This template is very convenient to use, suitable for the front end is not very familiar with the use of people can achieve professional results. Praise one.

Cut a picture first.

Implementation of the main point, the front-end with JS password with MD5 encrypted and passed to the backstage. Prevent password plaintext transmission.

Background controller implementation of key points, using Shiro password authentication.

    @RequestMapping (value= "/login", method=requestmethod.post) public String login (@ModelAttribute logindto login,          HttpServletRequest Request,model Model, Bindingresult bindingresult, redirectattributes RedirectAttributes) {                try {logger.info ("login is:" +json.tojsonstring (login));                String code = (string) request.getsession (). getattribute ("code");        if (code! = null &&!code.equalsignorecase (Login.getcode ())) {Model.addattribute ("error", "wrong Captcha");                Model.addattribute ("Logindto", login);          return "/login";              } if (Bindingresult.haserrors ()) {return "/login";            }//Use the Permissions tool for user login, log in successfully after the jump to Shiro configuration Successurl, and the following return does not matter!            Usernamepasswordtoken token = new Usernamepasswordtoken (Login.getusername (), Login.getpassword ());            if (login.getrememberme () = = null) {Login.setrememberme (false);     }       Token.setrememberme (Login.getrememberme ());                        Securityutils.getsubject (). Login (token);          return "redirect:/";    } catch (Authenticationexception e) {//redirectattributes.addflashattribute ("message", "User name or password error");    Model.addattribute ("Error", "Wrong user name or password");            Model.addattribute ("Logindto", login);          return "/login";   }

  

Spring MVC 4.3.2 + mybatis 3.4.1 + mysql 5.7.14 +shiro Kindergarten fee System Login

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.