实名校验黑名单用户
This commit is contained in:
@@ -14,8 +14,10 @@ import com.sqx.common.utils.DataLimitUtil;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.app.annotation.Login;
|
||||
import com.sqx.modules.app.annotation.LoginUser;
|
||||
import com.sqx.modules.app.entity.TbUserBlacklist;
|
||||
import com.sqx.modules.app.entity.UserEntity;
|
||||
import com.sqx.modules.app.entity.UserInfo;
|
||||
import com.sqx.modules.app.mapper.TbUserBlacklistMapper;
|
||||
import com.sqx.modules.app.service.AliService;
|
||||
import com.sqx.modules.app.service.AppService;
|
||||
import com.sqx.modules.app.service.UserInfoService;
|
||||
@@ -23,6 +25,7 @@ import com.sqx.modules.app.service.UserService;
|
||||
import com.sqx.modules.common.service.CommonInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -37,6 +40,7 @@ import java.util.Map;
|
||||
@RestController
|
||||
@RequestMapping("/app/user")
|
||||
@Api(value = "APP管理", tags = {"APP管理"})
|
||||
@Slf4j
|
||||
public class AppController {
|
||||
|
||||
@Autowired
|
||||
@@ -47,6 +51,8 @@ public class AppController {
|
||||
private CommonInfoService commonRepository;
|
||||
private final UserInfoService userInfoService;
|
||||
private final AliService aliService;
|
||||
@Autowired
|
||||
private TbUserBlacklistMapper tbUserBlacklistMapper;
|
||||
|
||||
public AppController(UserInfoService userInfoService, AliService aliService) {
|
||||
this.userInfoService = userInfoService;
|
||||
@@ -156,6 +162,16 @@ public class AppController {
|
||||
}
|
||||
|
||||
try {
|
||||
// 校验实名信息是否在黑名单里面
|
||||
Integer count = tbUserBlacklistMapper.selectCount(new LambdaQueryWrapper<TbUserBlacklist>().eq(TbUserBlacklist::getRealName, certName)
|
||||
.eq(TbUserBlacklist::getIdCardNo, certNum));
|
||||
if (count > 0) {
|
||||
userEntity.setStatus(0);
|
||||
userService.update(userEntity, new LambdaQueryWrapper<UserEntity>().eq(UserEntity::getUserId, userId));
|
||||
log.warn("异常行为用户:实名信息异常: {}", userId);
|
||||
return Result.error("异常行为: 您的实名信息存在异常行为");
|
||||
}
|
||||
|
||||
aliService.authCertNo(certName, certNum);
|
||||
userInfo.setCertName(certName);
|
||||
userInfo.setCertNo(certNum);
|
||||
|
||||
Reference in New Issue
Block a user