四要素认证暂时关闭

This commit is contained in:
GYJ 2025-01-08 22:27:15 +08:00
parent 625a2aeb9b
commit 09b6469cc5
1 changed files with 41 additions and 40 deletions

View File

@ -157,46 +157,47 @@ public class AppController {
@RequestParam String accountNo,
@RequestParam String mobile
) {
if (StrUtil.isAllBlank(certName, certNum, accountNo, mobile)) {
return Result.error("真实姓名、身份证号码、银行卡号、银行预留手机号缺一不可");
}
if(certNum.contains("*") || accountNo.contains("*") || mobile.contains("*")){
return Result.success();
}
int count = userInfoService.count(new LambdaQueryWrapper<UserInfo>().eq(UserInfo::getUserId, userId).eq(UserInfo::getCertName, certName).eq(UserInfo::getCertNo, certNum).isNotNull(UserInfo::getAccountNo).isNotNull(UserInfo::getMobile));
if (count > 0) {
return Result.error("已完成实名认证,无需重复操作");
}
count = userInfoService.count(new LambdaQueryWrapper<UserInfo>().ne(UserInfo::getUserId, userId).eq(UserInfo::getCertName, certName).eq(UserInfo::getCertNo, certNum).isNotNull(UserInfo::getAccountNo).isNotNull(UserInfo::getMobile));
if (count > 0) {
return Result.error("实名认证失败: 此身份证信息已被其他账号绑定");
}
if (!ApiAccessLimitUtil.getCertAuthIsAccessAllowed(String.valueOf(userId), "updateAuthCertInfo", 5)) {
return Result.error("实名修改失败: 每月可修改次数已用完,请联系管理员");
}
String respJson = aliService.auth(certName, certNum, accountNo, mobile);
UserInfo userInfo = userInfoService.getByUserId(userId);
userInfo.setCertName(certName);
userInfo.setCertNo(certNum);
userInfo.setAccountNo(accountNo);
userInfo.setMobile(mobile);
userInfo.setRespJson(respJson);
userInfo.setUpdateTime(DateUtil.date());
boolean update = userInfoService.update(userInfo, new LambdaQueryWrapper<UserInfo>().eq(UserInfo::getUserId, userId).eq(UserInfo::getId, userInfo.getId()));
if (!update) {
return Result.error("实名修改失败: 请稍后重试");
}
ApiAccessLimitUtil.setCertAuthIsAccessAllowed(String.valueOf(userId), "updateAuthCertInfo", 1, "month");
// 校验实名信息是否在黑名单里面
count = tbUserBlacklistMapper.selectCount(new LambdaQueryWrapper<TbUserBlacklist>().eq(TbUserBlacklist::getIdCardNo, certNum));
if (count > 0) {
UserEntity userEntity = userService.getById(userId);
userEntity.setStatus(0);
userService.update(userEntity, new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getUserId, userId));
log.warn("异常行为用户:实名信息异常: {}", userId);
return Result.error("异常行为: 您的实名信息存在异常行为");
}
return Result.success();
return Result.error("系统优化中,请稍后再试");
// if (StrUtil.isAllBlank(certName, certNum, accountNo, mobile)) {
// return Result.error("真实姓名、身份证号码、银行卡号、银行预留手机号缺一不可");
// }
// if(certNum.contains("*") || accountNo.contains("*") || mobile.contains("*")){
// return Result.success();
// }
// int count = userInfoService.count(new LambdaQueryWrapper<UserInfo>().eq(UserInfo::getUserId, userId).eq(UserInfo::getCertName, certName).eq(UserInfo::getCertNo, certNum).isNotNull(UserInfo::getAccountNo).isNotNull(UserInfo::getMobile));
// if (count > 0) {
// return Result.error("已完成实名认证,无需重复操作");
// }
// count = userInfoService.count(new LambdaQueryWrapper<UserInfo>().ne(UserInfo::getUserId, userId).eq(UserInfo::getCertName, certName).eq(UserInfo::getCertNo, certNum).isNotNull(UserInfo::getAccountNo).isNotNull(UserInfo::getMobile));
// if (count > 0) {
// return Result.error("实名认证失败: 此身份证信息已被其他账号绑定");
// }
// if (!ApiAccessLimitUtil.getCertAuthIsAccessAllowed(String.valueOf(userId), "updateAuthCertInfo", 5)) {
// return Result.error("实名修改失败: 每月可修改次数已用完,请联系管理员");
// }
// String respJson = aliService.auth(certName, certNum, accountNo, mobile);
// UserInfo userInfo = userInfoService.getByUserId(userId);
// userInfo.setCertName(certName);
// userInfo.setCertNo(certNum);
// userInfo.setAccountNo(accountNo);
// userInfo.setMobile(mobile);
// userInfo.setRespJson(respJson);
// userInfo.setUpdateTime(DateUtil.date());
// boolean update = userInfoService.update(userInfo, new LambdaQueryWrapper<UserInfo>().eq(UserInfo::getUserId, userId).eq(UserInfo::getId, userInfo.getId()));
// if (!update) {
// return Result.error("实名修改失败: 请稍后重试");
// }
// ApiAccessLimitUtil.setCertAuthIsAccessAllowed(String.valueOf(userId), "updateAuthCertInfo", 1, "month");
// // 校验实名信息是否在黑名单里面
// count = tbUserBlacklistMapper.selectCount(new LambdaQueryWrapper<TbUserBlacklist>().eq(TbUserBlacklist::getIdCardNo, certNum));
// if (count > 0) {
// UserEntity userEntity = userService.getById(userId);
// userEntity.setStatus(0);
// userService.update(userEntity, new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getUserId, userId));
// log.warn("异常行为用户:实名信息异常: {}", userId);
// return Result.error("异常行为: 您的实名信息存在异常行为");
// }
// return Result.success();
}