Commit 7a985147 authored by 董建华's avatar 董建华

调整sql

parent d8a340e6
......@@ -146,6 +146,16 @@ public class LoginInterceptorAspect {
return LoginRefuseResult.builder()
.isPass(Boolean.TRUE).build();
}
/**
* 阈值
*/
Long threshold = DEVICE_REFUSE_STRATEGY.get(device);
if (null == threshold) {
log.warn("非安卓或者IOS设备登录没有策略就放过phone:{},device:{}", phone, device);
return LoginRefuseResult.builder()
.isPass(Boolean.TRUE).build();
}
Long deviceNum = loginInfoRepository.countByDeviceId(deviceId);
......@@ -169,17 +179,6 @@ public class LoginInterceptorAspect {
.isPass(Boolean.TRUE)
.build();
}
/**
* 阈值
*/
Long threshold = DEVICE_REFUSE_STRATEGY.get(device);
if (null == threshold) {
log.warn("非安卓或者IOS设备登录没有策略就放过phone:{},device:{}", phone, device);
return LoginRefuseResult.builder()
.isPass(Boolean.TRUE).build();
}
/**
* 实际的数量
*/
......
......@@ -17,7 +17,7 @@ import javax.persistence.*;
{
@NamedNativeQuery(
name = "LoginInfo.countByPhoneAndDevice",
query = "select count(DISTINCT device_id) num ,device from login_info where phone_no=?1 and device =?2 and created_at > DATE_ADD(CURRENT_TIMESTAMP(),INTERVAL -90 DAY) group by device",
query = "select count(DISTINCT device_id) num ,device from login_info where phone_no=?1 and device =?2 and created_at > DATE_ADD(CURRENT_TIMESTAMP(),INTERVAL -90 DAY)",
resultClass = CountDevice.class
)
}
......
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