拉黑用户时 记录用户行为
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.sqx.modules.app.interceptor;
|
||||
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@@ -94,9 +95,7 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
|
||||
log.warn("用户地址跳动频繁,封禁: {}", userId);
|
||||
if (!redisService.isSetUserState(userId)) {
|
||||
ThreadUtil.execAsync(() -> {
|
||||
userService.update(null, new LambdaUpdateWrapper<UserEntity>()
|
||||
.eq(UserEntity::getUserId, userId)
|
||||
.set(UserEntity::getStatus, 0));
|
||||
userService.addBlackUser(userId,"IP频繁跳动");
|
||||
});
|
||||
}
|
||||
throw new CzgException("ip跳动过于频繁,请联系管理员解封");
|
||||
|
||||
Reference in New Issue
Block a user