| | |
| | | package com.stylefeng.guns.modular.system.controller.system; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.google.code.kaptcha.Constants; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.exception.InvalidKaptchaException; |
| | |
| | | * 点击登录执行的动作 |
| | | */ |
| | | @RequestMapping(value = "/login", method = RequestMethod.POST) |
| | | public String loginVali() { |
| | | public String loginVali(Model model) { |
| | | |
| | | String username = super.getPara("username").trim(); |
| | | String password = super.getPara("password").trim(); |
| | | String remember = super.getPara("remember"); |
| | | User user = userService.selectOne(new EntityWrapper<User>().eq("account", username).ne("status", 3)); |
| | | if(null == user){ |
| | | model.addAttribute("tips", "账户无效"); |
| | | return "/login.html"; |
| | | } |
| | | if(user.getStatus() == 2){ |
| | | model.addAttribute("tips", "账户已被冻结"); |
| | | return "/login.html"; |
| | | } |
| | | String s = ShiroKit.md5(password, user.getSalt()); |
| | | if(!user.getPassword().equals(s)){ |
| | | model.addAttribute("tips", "账号密码错误"); |
| | | return "/login.html"; |
| | | } |
| | | |
| | | //验证验证码是否正确 |
| | | if (KaptchaUtil.getKaptchaOnOff()) { |