成为主播指纹校验修改
This commit is contained in:
parent
c376c42efe
commit
e8075d5384
@ -109,13 +109,21 @@ public interface LatestMobileDeviceService extends BaseService<LatestMobileDevic
|
||||
Set<Long> getImeiUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 获取用户设备指纹(旧版)
|
||||
* 获取用户设备指纹 IP段
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 设备指纹字符串
|
||||
*/
|
||||
String getDeviceFingerprintByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 获取用户设备指纹 全IP
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 设备指纹字符串
|
||||
*/
|
||||
String getDeviceFingerprintAndIPByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 获取用户设备指纹(增强版)
|
||||
* 包含:手机型号 + 系统版本 + IP段 + 编译版本
|
||||
|
||||
@ -300,6 +300,30 @@ public class LatestMobileDeviceServiceImpl extends
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDeviceFingerprintAndIPByUserId(Long userId) {
|
||||
if (userId == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
LatestMobileDevice device = query()
|
||||
.eq(LatestMobileDevice::getUserId, userId)
|
||||
.last(PageConstant.LIMIT_ONE)
|
||||
.getOne();
|
||||
|
||||
if (device == null) {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(device.getRequestClient())
|
||||
|| StringUtils.isBlank(device.getPhoneModel())
|
||||
|| StringUtils.isBlank(device.getIp())) {
|
||||
return "";
|
||||
}
|
||||
|
||||
return device.getRequestClient() + "|" + device.getPhoneModel() + "|" + device.getIp();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEnhancedDeviceFingerprintByUserId(Long userId) {
|
||||
if (userId == null) {
|
||||
@ -386,7 +410,7 @@ public class LatestMobileDeviceServiceImpl extends
|
||||
.select(LatestMobileDevice::getUserId)
|
||||
.eq(LatestMobileDevice::getRequestClient, requestClient)
|
||||
.eq(LatestMobileDevice::getPhoneModel, phoneModel)
|
||||
.likeRight(LatestMobileDevice::getIp, ipPrefix) // 前缀匹配
|
||||
.eq(LatestMobileDevice::getIp, ipPrefix) // 前缀匹配
|
||||
.eq(LatestMobileDevice::getSysOrigin, sysOrigin)
|
||||
.last(PageConstant.formatLimit(500))
|
||||
.list())
|
||||
|
||||
@ -93,7 +93,7 @@ public class RegisterDeviceGatewayImpl implements RegisterDeviceGateway {
|
||||
return false;
|
||||
}
|
||||
|
||||
String fingerprint = latestMobileDeviceService.getDeviceFingerprintByUserId(userId);
|
||||
String fingerprint = latestMobileDeviceService.getDeviceFingerprintAndIPByUserId(userId);
|
||||
if (StringUtils.isBlank(fingerprint)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -252,7 +252,7 @@ public class RegisterDeviceClientServiceImpl implements RegisterDeviceClientServ
|
||||
return false;
|
||||
}
|
||||
|
||||
String fingerprint = latestMobileDeviceService.getDeviceFingerprintByUserId(userId);
|
||||
String fingerprint = latestMobileDeviceService.getDeviceFingerprintAndIPByUserId(userId);
|
||||
if (StringUtils.isBlank(fingerprint)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user