Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -8,19 +8,21 @@ import lombok.Data;
|
|||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付宝黑名单
|
* 用户黑名单
|
||||||
* @author tankaikai
|
* @author tankaikai
|
||||||
* @since 2025-01-07 12:56
|
* @since 2025-01-07 12:56
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@TableName(value ="alipay_blacklist")
|
@TableName(value ="tb_user_blacklist")
|
||||||
public class AlipayBlacklist implements Serializable {
|
public class TbUserBlacklist implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@TableId(type=IdType.INPUT)
|
@TableId(type=IdType.AUTO)
|
||||||
private String alipayAccountNo;
|
private Long id;
|
||||||
|
|
||||||
private String alipayAccountName;
|
private String idCardNo;
|
||||||
|
|
||||||
|
private String realName;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -61,6 +61,18 @@ public class UserEntity implements Serializable {
|
|||||||
@ApiModelProperty("性别 1男 2女")
|
@ApiModelProperty("性别 1男 2女")
|
||||||
private Integer sex;
|
private Integer sex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 姓名
|
||||||
|
*/
|
||||||
|
@TableField("cert_name")
|
||||||
|
private String certName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份证号码
|
||||||
|
*/
|
||||||
|
@TableField("cert_no")
|
||||||
|
private String certNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信小程序openid
|
* 微信小程序openid
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -4,14 +4,15 @@ package com.sqx.modules.app.interceptor;
|
|||||||
import cn.hutool.core.thread.ThreadUtil;
|
import cn.hutool.core.thread.ThreadUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.sqx.common.exception.CzgException;
|
import com.sqx.common.exception.CzgException;
|
||||||
import com.sqx.common.exception.SqxException;
|
import com.sqx.common.exception.SqxException;
|
||||||
import com.sqx.common.utils.DateUtils;
|
import com.sqx.common.utils.DateUtils;
|
||||||
import com.sqx.common.utils.IPUtils;
|
import com.sqx.common.utils.IPUtils;
|
||||||
import com.sqx.modules.app.annotation.Login;
|
import com.sqx.modules.app.annotation.Login;
|
||||||
import com.sqx.modules.app.entity.AlipayBlacklist;
|
import com.sqx.modules.app.entity.TbUserBlacklist;
|
||||||
import com.sqx.modules.app.entity.UserEntity;
|
import com.sqx.modules.app.entity.UserEntity;
|
||||||
import com.sqx.modules.app.mapper.AlipayBlacklistMapper;
|
import com.sqx.modules.app.mapper.TbUserBlacklistMapper;
|
||||||
import com.sqx.modules.app.service.UserService;
|
import com.sqx.modules.app.service.UserService;
|
||||||
import com.sqx.modules.app.utils.JwtUtils;
|
import com.sqx.modules.app.utils.JwtUtils;
|
||||||
import com.sqx.modules.redisService.RedisService;
|
import com.sqx.modules.redisService.RedisService;
|
||||||
@@ -40,7 +41,7 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private UserService userService;
|
private UserService userService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private AlipayBlacklistMapper alipayBlacklistMapper;
|
private TbUserBlacklistMapper tbUserBlacklistMapper;
|
||||||
|
|
||||||
private final RedisService redisService;
|
private final RedisService redisService;
|
||||||
|
|
||||||
@@ -106,10 +107,10 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
|
|||||||
throw new CzgException("异常行为用户: {}" + user.getUserId());
|
throw new CzgException("异常行为用户: {}" + user.getUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(StrUtil.isNotBlank(user.getZhiFuBao())){
|
if (StrUtil.isNotBlank(user.getCertNo())) {
|
||||||
AlipayBlacklist blacklist = alipayBlacklistMapper.selectById(user.getZhiFuBao());
|
TbUserBlacklist blacklist = tbUserBlacklistMapper.selectOne(Wrappers.<TbUserBlacklist>lambdaQuery().eq(TbUserBlacklist::getIdCardNo, user.getCertNo()));
|
||||||
if(blacklist != null){
|
if (blacklist != null) {
|
||||||
throw new CzgException("禁止访问");
|
throw new CzgException(StrUtil.format("黑名单用户,禁止访问:{} / {}", blacklist.getRealName(), blacklist.getIdCardNo()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.sqx.modules.app.mapper;
|
package com.sqx.modules.app.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.sqx.modules.app.entity.AlipayBlacklist;
|
import com.sqx.modules.app.entity.TbUserBlacklist;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -10,5 +10,5 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
* @since 2025-01-07 12:56
|
* @since 2025-01-07 12:56
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface AlipayBlacklistMapper extends BaseMapper<AlipayBlacklist> {
|
public interface TbUserBlacklistMapper extends BaseMapper<TbUserBlacklist> {
|
||||||
}
|
}
|
||||||
@@ -127,7 +127,7 @@ spring:
|
|||||||
- qrtz_cron_triggers
|
- qrtz_cron_triggers
|
||||||
- qrtz_calendars
|
- qrtz_calendars
|
||||||
- qrtz_blob_triggers
|
- qrtz_blob_triggers
|
||||||
- alipay_blacklist
|
- tb_user_blacklist
|
||||||
|
|
||||||
# 日志配置
|
# 日志配置
|
||||||
logging:
|
logging:
|
||||||
|
|||||||
Reference in New Issue
Block a user