增强验证码校验的语义,更易懂

pull/217/head
Gszekt 2020-09-28 20:27:57 +08:00 committed by Gitee
parent 613a21edd0
commit 8610033c26
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ public class SysLoginService
public SysUser login(String username, String password)
{
// 验证码校验
if (!StringUtils.isEmpty(ServletUtils.getRequest().getAttribute(ShiroConstants.CURRENT_CAPTCHA)))
if (ShiroConstants.CAPTCHA_ERROR.equals(ServletUtils.getRequest().getAttribute(ShiroConstants.CURRENT_CAPTCHA)))
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
throw new CaptchaException();