Pu Zhibing
2025-01-20 6762f7a204a43e2cf4eaae3503d0621d224d4d88
修改bug
4个文件已修改
22 ■■■■ 已修改文件
ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysPasswordService.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/utils/SecurityUtils.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/SeckillActivityInfoMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysLoginService.java
@@ -93,7 +93,6 @@
        }
        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){
ruoyi-auth/src/main/java/com/ruoyi/auth/service/SysPasswordService.java
@@ -40,8 +40,7 @@
        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));
@@ -63,15 +62,7 @@
            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);
        }
    }
ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/utils/SecurityUtils.java
@@ -117,11 +117,9 @@
    
    
    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"));
    }
}
ruoyi-service/ruoyi-other/src/main/resources/mapper/other/SeckillActivityInfoMapper.xml
@@ -20,7 +20,7 @@
            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>