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