|
@@ -910,8 +910,8 @@ public class ExamServiceImpl implements ExamService {
|
|
if (null != clientIp) {
|
|
if (null != clientIp) {
|
|
// IP取前三段
|
|
// IP取前三段
|
|
clientIp = clientIp.substring(0, clientIp.lastIndexOf(".") + 1);
|
|
clientIp = clientIp.substring(0, clientIp.lastIndexOf(".") + 1);
|
|
- if (realIp.startsWith(clientIp)) {
|
|
|
|
- return true;
|
|
|
|
|
|
+ if (!realIp.startsWith(clientIp)) {
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -921,13 +921,14 @@ public class ExamServiceImpl implements ExamService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- //在黑名单中
|
|
|
|
|
|
+ //不在黑名单中
|
|
int count = examIpLimitRepo.countByExamIdAndLimitTypeAndIp(examId,IpLimitType.No_Access.getId(), realIp);
|
|
int count = examIpLimitRepo.countByExamIdAndLimitTypeAndIp(examId,IpLimitType.No_Access.getId(), realIp);
|
|
return count > 0;
|
|
return count > 0;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ return true;
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
}
|
|
}
|
|
- return false;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private String getIp(HttpServletRequest request) {
|
|
private String getIp(HttpServletRequest request) {
|