newbee-ltd / newbee-mall-plus

🔥 🎉newbee-mall-plus 项目是 newbee-mall 项目的升级版本,增加了优惠券模块、商品秒杀模块、支付宝支付,优化了搜索功能,后续会继续增加功能模块以及流行的技术栈。

Home Page:http://121.4.124.33:9001

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

登录时,如果登录失败,不会主动重新获取验证码,导致第二次提交时验证码为null,登陆失败

BabyLy233 opened this issue · comments

httpSession.setAttribute(Constants.MALL_VERIFY_CODE_KEY, null);
String loginResult = newBeeMallUserService.login(loginName, MD5Util.MD5Encode(password, Constants.UTF_ENCODING), httpSession);
        //登录成功
        if (ServiceResultEnum.SUCCESS.getResult().equals(loginResult)) {
            //删除session中的verifyCode
            httpSession.removeAttribute(Constants.MALL_VERIFY_CODE_KEY);
            return ResultGenerator.genSuccessResult();
        }
        //登录失败
        return ResultGenerator.genFailResult(loginResult);

控制层如上代码,不管用户登陆是否成功,都将session中的验证码置为null;
导致用户如果不主动刷新验证码,就会登陆失败,后端一直获取到null的验证码

已修复