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

修改bug

parent d9740ff6
...@@ -141,12 +141,13 @@ public class LoginInterceptorAspect { ...@@ -141,12 +141,13 @@ 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()
.isPass(Boolean.TRUE).build(); .isPass(Boolean.TRUE)
.build();
} }
log.warn("此设备登录命中拒绝策略存在白名单deviceId:{}", deviceId); log.warn("此设备登录命中拒绝策略deviceId:{}超过{}个拒绝登录", deviceId,deviceNum);
return LoginRefuseResult.builder() return LoginRefuseResult.builder()
.isPass(Boolean.FALSE) .isPass(Boolean.FALSE)
.rule(1) .rule(1)
......
package cn.quantgroup.xyqb.entity; package cn.quantgroup.xyqb.entity;
/**
* @author :dongjianhua
* @date :Created in 2020/11/23 9:46
* @description:
* @modified By:
* @version:
*/
import cn.quantgroup.xyqb.entity.enums.Device; import cn.quantgroup.xyqb.entity.enums.Device;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
import javax.persistence.Column; import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.NamedNativeQueries;
import javax.persistence.NamedNativeQuery;
/** /**
* 查询营销短信统计信息 * 查询营销短信统计信息
...@@ -37,7 +27,7 @@ package cn.quantgroup.xyqb.entity; ...@@ -37,7 +27,7 @@ package cn.quantgroup.xyqb.entity;
@Entity @Entity
public class CountDevice { public class CountDevice {
@Id
@Column(name = "device") @Column(name = "device")
private Device device; private Device device;
......
...@@ -16,7 +16,7 @@ public interface LoginInfoRepository extends JpaRepository<LoginInfo, Long> { ...@@ -16,7 +16,7 @@ public interface LoginInfoRepository extends JpaRepository<LoginInfo, Long> {
* @param deviceId 设备维度策略 * @param deviceId 设备维度策略
* @return * @return
*/ */
@Query(value = "select count(distinct device_id) from login_info where device_id=?1 and created_at> DATE_ADD(CURRENT_TIMESTAMP(),INTERVAL -90 DAY)", nativeQuery = true) @Query(value = "select count(distinct phone_no) from login_info where device_id=?1 and created_at> DATE_ADD(CURRENT_TIMESTAMP(),INTERVAL -90 DAY)", nativeQuery = true)
Long countByDeviceId(String deviceId); Long countByDeviceId(String deviceId);
......
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