qinchao hace 4 años
padre
commit
06d351926c

+ 1 - 1
examcloud-core-examwork-dao/src/main/java/cn/com/qmth/examcloud/core/examwork/dao/ExamIpLimitRepo.java

@@ -16,7 +16,7 @@ public interface ExamIpLimitRepo extends JpaRepository<ExamIpLimitEntity, Long>,
 
 	@Query(value = "SELECT count(1) from ec_e_exam_ip_limit t where t.exam_id = ?1 " +
 			"AND t.limit_type = ?2 AND ?3 REGEXP t.ip ",nativeQuery = true)
-	int countByExamIdAndLimitTypeAndIp(Long examId, IpLimitType limitType, String ip);
+	int countByExamIdAndLimitTypeAndIp(Long examId, String limitType, String ip);
 
 	@Modifying
 	@Transactional

+ 2 - 2
examcloud-core-examwork-service/src/main/java/cn/com/qmth/examcloud/core/examwork/service/impl/ExamServiceImpl.java

@@ -893,7 +893,7 @@ public class ExamServiceImpl implements ExamService {
             Boolean totalLimit = getExamLimitProperty(examId, ipTotalLimit.getId(), false);
             if (totalLimit) {
                 //在白名单中
-                int count = examIpLimitRepo.countByExamIdAndLimitTypeAndIp(examId, IpLimitType.HAS_ACCESS,realIp);
+                int count = examIpLimitRepo.countByExamIdAndLimitTypeAndIp(examId, IpLimitType.HAS_ACCESS.name(),realIp);
                 if (count>0) {
                     //学习中心访问控制
                     DynamicEnum ipCenterLimit = manager.getByName("IP_CENTER_LIMIT");
@@ -927,7 +927,7 @@ public class ExamServiceImpl implements ExamService {
                 }
             } else {
                 //不在黑名单中
-                int count = examIpLimitRepo.countByExamIdAndLimitTypeAndIp(examId,IpLimitType.NO_ACCESS, realIp);
+                int count = examIpLimitRepo.countByExamIdAndLimitTypeAndIp(examId,IpLimitType.NO_ACCESS.name(), realIp);
                 return count > 0;
             }
             return true;