Commit 7896e132 authored by liwei's avatar liwei

修改了实名认证接口逻辑

parent 2eb2165c
......@@ -149,7 +149,7 @@ public class AppOpmArticleController extends CyPaginationController<OpmArticle>
* 逻辑删除评论
*/
@PreAuthorize("@cyPerm.hasPerm('app:opmArticle:delete')")
@DeleteMapping("/deleteComment/{businessId:\\w+}")
@DeleteMapping("/opmArticle/deleteComment/{businessId:\\w+}")
public CyResult deleteComment(@PathVariable String businessId,@RequestBody ArticleCommentDTO dto) {
dto.setBusinessId(Integer.valueOf(businessId));
CyPersistModel data = opmArticleServiceImpl.removeComment(dto,"app");
......
......@@ -248,21 +248,6 @@ public class AppMemInfoController extends CyPaginationController<MemInfo> {
}
}
@PreAuthorize("@cyPerm.hasPerm('app:mem:query')")
@CyOpeLogAnno(title = "system-会员表管理-校验实名认证信息", businessType = CyLogTypeEnum.UPDATE)
@Operation(summary="校验实名认证信息", description="校验实名认证信息")
@Parameters({@Parameter(name = "businessId", description = "businessId", required = false, schema = @Schema(type = "string"))})
@PutMapping("/memInfo/checkIdCard/{userId:\\w+}")
@CyEncryptSm4Anno
public CyResult checkIdCard(@PathVariable int userId, @RequestBody MemInfo memInfo, BindingResult bindingResult) {
memInfo.setUserId(userId);
CyPersistModel data = memInfoServiceImpl.checkIdCard(memInfo);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
memInfo);
}
/**
* 会员基础信息页面-修改个人资料
*/
......
......@@ -95,8 +95,6 @@ public interface MemInfoService {
ArticleExamStatus getArticle(ArticleExamStatus articleExamStatus );
CyPersistModel checkIdCard(MemInfo memInfo);
CyPersistModel update(MemInfo memInfo);
CyPersistModel addFollow(MemFollowDTO followDTO);
......
......@@ -88,8 +88,6 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
@Autowired
private DictionaryService dictionaryService;
@Autowired
private CyRedisService cyRedisService;
@Autowired
private StringRedisTemplate redisTemplate;
@Autowired
private MemInfoRepository memInfoRepository;
......@@ -536,63 +534,6 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
}
/**
* 修改 会员表
* @param memInfo
* @return
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel checkIdCard(MemInfo memInfo){
MemInfo info = baseMapper.getInfoByUserId(String.valueOf(memInfo.getUserId()));
if ("1".equals(info.getMemRealAuthen()))
throw new CyServiceException("用户已实名,无需再次实名认证");
//手机号、身份证存储加密
// if (StringUtils.isNotBlank(memInfo.getMemIdcard()))
// info.setMemIdcard(CyAESUtils.encrypt(memInfo.getMemIdcard()));
// if (StringUtils.isNotBlank(memInfo.getMemRealName()))
// info.setMemRealName(CyAESUtils.encrypt(memInfo.getMemRealName()));
//身份证验重
SysUserRbacDTO sysUserRbacDTO = baseMapper.checkIdcardRepeat(memInfo.getUserId(),CyAESUtils.encrypt(memInfo.getMemIdcard()));
if (sysUserRbacDTO != null) {
throw new CyServiceException(UserInfoExceptionEnums.ID_NUMBER_EXISTS);
}
//验证失败次数
//获取ip
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String ip = CyAddressUtils.IpUtils.getIpAddr(request);
//1. 同一IP,每分钟失败次数
Object captcha = cyRedisServiceImpl.get(FaceVerifyRedisBean.FACEVERIFY_IP_MINUTES + ip);
if (captcha != null) {
int count = (int)captcha;
if (count >= faceVerifyAliComp.getIpMinCount())
throw new CyServiceException("当前IP实名认证发起频繁,请稍后重试");
}
//2. 同一IP,每天失败次数
captcha = cyRedisServiceImpl.get(FaceVerifyRedisBean.FACEVERIFY_IP_DAY + ip);
if (captcha != null) {
int count = (int)captcha;
if (count >= faceVerifyAliComp.getIpDayCount())
throw new CyServiceException("当前IP实名认证次数已达上限,请明日再试!");
}
//3. 同一身份证,每分钟失败次数
captcha = cyRedisServiceImpl.get(FaceVerifyRedisBean.FACEVERIFY_IDCARD_MINUTES + memInfo.getMemIdcard());
if (captcha != null) {
int count = (int)captcha;
if (count >= faceVerifyAliComp.getIdCardMinCount())
throw new CyServiceException("实名认证发起频繁,请稍后重试");
}
//4. 同一身份证,每天失败次数
captcha = cyRedisServiceImpl.get(FaceVerifyRedisBean.FACEVERIFY_IDCARD_DAY + memInfo.getMemIdcard());
if (captcha != null) {
int count = (int)captcha;
if (count >= faceVerifyAliComp.getIdCardDayCount())
throw new CyServiceException("实名认证次数已达上限,请明日再试!");
}
cyRedisServiceImpl.set(FaceVerifyRedisBean.FACEVERIFY_USER+memInfo.getUserId(),memInfo,3600L);
return new CyPersistModel(1);
}
/**
* 修改 会员表
* @param memInfo
......
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