| | |
| | | } |
| | | if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { |
| | | recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "用户已停用,请联系管理员"); |
| | | // throw new ServiceException("对不起,您的账号:" + username + " 已停用"); |
| | | throw new ServiceException("您所属门店已被冻结,请联系平台"); |
| | | } |
| | | if (user.getRoleType()==2){ |
| | |
| | | return CacheConstants.PWD_ERR_CNT_KEY + username; |
| | | } |
| | | |
| | | public void validate(SysUser user, String password, HttpServletRequest request) |
| | | { |
| | | public void validate(SysUser user, String password, HttpServletRequest request) { |
| | | String username = user.getUserName(); |
| | | |
| | | Integer retryCount = redisService.getCacheObject(getCacheKey(username)); |
| | |
| | | recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, String.format("密码输入错误%s次", retryCount)); |
| | | redisService.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES); |
| | | throw new ServiceException("密码错误"); |
| | | } |
| | | // if (!user.getPassword().equals(password)){ |
| | | // retryCount = retryCount + 1; |
| | | // recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, String.format("密码输入错误%s次", retryCount)); |
| | | // redisService.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES); |
| | | // throw new ServiceException("密码错误"); |
| | | // } |
| | | else |
| | | { |
| | | } else { |
| | | clearLoginRecordCache(username); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | String s = encryptPassword("ad23a8ac3c902145ffe05df05812b1f0"); |
| | | String s = encryptPassword("0192023a7bbd73250516f069df18b500"); |
| | | System.err.println(s); |
| | | // System.err.println(s); |
| | | |
| | | System.err.println(matchesPassword("6ac9d3a5c7639060425fadd6db3d305e","$2a$10$M.L9orN4p8y6aLvBhOm9hevAmi0YXAPuWIHZrAyEAKGW3x8B4/0d.")); |
| | | System.err.println(matchesPassword("ad23a8ac3c902145ffe05df05812b1f0","$2a$10$Rw0A4NjcdqnNrImdOn4EI.z.Ib.XfpY01NPPs9kSsF42JxGrMrJBy")); |
| | | System.err.println(matchesPassword("c4ca4238a0b923820dcc509a6f75849b", "$2a$10$/7z/wiZ2ejTjD4GQuuyiSe1ptS8uoxrRAUlGCitiLEmpOO78cISeq")); |
| | | } |
| | | } |
| | |
| | | t_seckill_activity_info tsai |
| | | LEFT JOIN t_goods tg ON tsai.good_id = tg.id |
| | | LEFT JOIN t_goods_seckill tgs ON tgs.seckill_activity_info_id = tsai.id and tgs.vip = #{vipId} |
| | | WHERE tsai.is_shelves = 1 AND tsai.del_flag = 0 and tsai.end_time < now() |
| | | WHERE tsai.is_shelves = 1 AND tsai.del_flag = 0 and tsai.end_time >= now() |
| | | <if test="name != null and name != ''"> |
| | | AND tg.`name` LIKE concat('%',#{name},'%') |
| | | </if> |