Commit e699da13 authored by 董建华's avatar 董建华

增加enable

parent 1f46082c
...@@ -141,7 +141,7 @@ public class LoginInterceptorAspect { ...@@ -141,7 +141,7 @@ public class LoginInterceptorAspect {
Long deviceNum = loginInfoRepository.countByDeviceId(deviceId); Long deviceNum = loginInfoRepository.countByDeviceId(deviceId);
if (DEVICE_REFUSE_COUNT.compareTo(deviceNum) < 0) { if (DEVICE_REFUSE_COUNT.compareTo(deviceNum) <= 0) {
if (isWhite(deviceId, KeyType.DEVICEID)) { if (isWhite(deviceId, KeyType.DEVICEID)) {
log.warn("此设备登录命中拒绝策略,但是在白名单deviceId:{}", deviceId, deviceNum); log.warn("此设备登录命中拒绝策略,但是在白名单deviceId:{}", deviceId, deviceNum);
return LoginRefuseResult.builder() return LoginRefuseResult.builder()
...@@ -267,7 +267,7 @@ public class LoginInterceptorAspect { ...@@ -267,7 +267,7 @@ public class LoginInterceptorAspect {
* @return * @return
*/ */
private boolean isWhite(String key, KeyType type) { private boolean isWhite(String key, KeyType type) {
return whiteListRepository.countByKeyEqualsAndTypeEquals(key, type) > 0; return whiteListRepository.countByKeyEqualsAndTypeEqualsAndEnableIsTrue(key, type) > 0;
} }
/** /**
* 【登录设备反欺诈策略】 * 【登录设备反欺诈策略】
......
...@@ -7,5 +7,5 @@ import org.springframework.data.jpa.repository.JpaRepository; ...@@ -7,5 +7,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
public interface WhiteListRepository extends JpaRepository<WhiteList, Long> { public interface WhiteListRepository extends JpaRepository<WhiteList, Long> {
Long countByKeyEqualsAndTypeEquals(String key, KeyType type); Long countByKeyEqualsAndTypeEqualsAndEnableIsTrue(String key, KeyType type);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment