mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-22 15:21:53 +08:00
多模块重构 14:MEMBER 用户,过滤掉操作日志的记录~
This commit is contained in:
parent
6441883855
commit
ae9186f4b4
@ -4,6 +4,7 @@ import cn.hutool.core.exceptions.ExceptionUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.servlet.ServletUtil;
|
||||
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.dto.OperateLogCreateReqDTO;
|
||||
@ -81,6 +82,12 @@ public class OperateLogAspect {
|
||||
}
|
||||
|
||||
private Object around0(ProceedingJoinPoint joinPoint, OperateLog operateLog, ApiOperation apiOperation) throws Throwable {
|
||||
// 目前,只有管理员,才记录操作日志!所以非管理员,直接调用,不进行记录
|
||||
Integer userType = WebFrameworkUtils.getLoginUserType();
|
||||
if (!Objects.equals(userType, UserTypeEnum.ADMIN.getValue())) {
|
||||
return joinPoint.proceed();
|
||||
}
|
||||
|
||||
// 记录开始时间
|
||||
Date startTime = new Date();
|
||||
try {
|
||||
|
@ -10,8 +10,8 @@ import org.springframework.security.config.annotation.web.configurers.Expression
|
||||
/**
|
||||
* Infra 模块的 Security 配置
|
||||
*/
|
||||
@Configuration
|
||||
public class InfraSecurityConfiguration {
|
||||
@Configuration("infraSecurityConfiguration")
|
||||
public class SecurityConfiguration {
|
||||
|
||||
@Value("${spring.boot.admin.context-path:''}")
|
||||
private String adminSeverContextPath;
|
@ -1,11 +1,14 @@
|
||||
### 请求 /member/user/profile/get 接口 => 没有权限
|
||||
GET {{userServerUrl}}/member/user/profile/get
|
||||
GET {{appApi}}/member/user/get
|
||||
Authorization: Bearer test245
|
||||
tenant-id: {{appTenentId}}
|
||||
|
||||
### 请求 /member/user/profile/revise-nickname 接口 成功
|
||||
PUT {{userServerUrl}}/member/user/profile/update-nickname?nickName=yunai222
|
||||
PUT {{appApi}}/member/user/update-nickname?nickname=yunai222
|
||||
Authorization: Bearer test245
|
||||
tenant-id: {{appTenentId}}
|
||||
|
||||
### 请求 /member/user/profile/get-user-info 接口 成功
|
||||
GET {{userServerUrl}}/member/user/profile/get-user-info?id=245
|
||||
### 请求 /member/user/get-user-info 接口 成功
|
||||
GET {{appApi}}/member/user/get-user-info?id=245
|
||||
Authorization: Bearer test245
|
||||
tenant-id: {{appTenentId}}
|
||||
|
@ -3,14 +3,12 @@ package cn.iocoder.yudao.module.pay.dal.redis;
|
||||
import cn.iocoder.yudao.framework.redis.core.RedisKeyDefine;
|
||||
import org.redisson.api.RLock;
|
||||
|
||||
import static cn.iocoder.yudao.framework.redis.core.RedisKeyDefine.KeyTypeEnum.HASH;
|
||||
|
||||
/**
|
||||
* 支付 Redis Key 枚举类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface PayRedisKeyCoreConstants {
|
||||
public interface RedisKeyConstants {
|
||||
|
||||
RedisKeyDefine PAY_NOTIFY_LOCK = new RedisKeyDefine("通知任务的分布式锁",
|
||||
"pay_notify:lock:", // 参数来自 DefaultLockKeyBuilder 类
|
@ -7,7 +7,7 @@ import org.springframework.stereotype.Repository;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static cn.iocoder.yudao.module.pay.dal.redis.PayRedisKeyCoreConstants.PAY_NOTIFY_LOCK;
|
||||
import static cn.iocoder.yudao.module.pay.dal.redis.RedisKeyConstants.PAY_NOTIFY_LOCK;
|
||||
|
||||
/**
|
||||
* 支付通知的锁 Redis DAO
|
||||
|
@ -1,6 +1,6 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.logger;
|
||||
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum;
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
@ -48,9 +48,15 @@ public class OperateLogDO extends TenantBaseDO {
|
||||
/**
|
||||
* 用户编号
|
||||
*
|
||||
* {@link AdminUserDO#getId()}
|
||||
* 关联 MemberUserDO 的 id 属性,或者 AdminUserDO 的 id 属性
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户类型
|
||||
*
|
||||
* 关联 {@link UserTypeEnum}
|
||||
*/
|
||||
private Integer userType;
|
||||
/**
|
||||
* 操作模块
|
||||
*/
|
||||
|
@ -27,7 +27,7 @@ public interface RedisKeyConstants {
|
||||
"social_auth_user:%d:%s", // 参数为 type,code
|
||||
STRING, AuthUser.class, Duration.ofDays(1));
|
||||
|
||||
RedisKeyDefine SOCIAL_AUTH_STATE = new RedisKeyDefine("社交登陆的 state",
|
||||
RedisKeyDefine SOCIAL_AUTH_STATE = new RedisKeyDefine("社交登陆的 state", // 注意,它是被 JustAuth 的 justauth.type.prefix 使用到
|
||||
"social_auth_state:%s", // 参数为 state
|
||||
STRING, String.class, Duration.ofHours(24)); // 值为 state
|
||||
|
||||
|
@ -9,8 +9,8 @@ import org.springframework.security.config.annotation.web.configurers.Expression
|
||||
/**
|
||||
* System 模块的 Security 配置
|
||||
*/
|
||||
@Configuration
|
||||
public class SystemSecurityConfiguration {
|
||||
@Configuration("systemSecurityConfiguration")
|
||||
public class SecurityConfiguration {
|
||||
|
||||
@Bean("systemAuthorizeRequestsCustomizer")
|
||||
public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() {
|
@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.scheduling.annotation.AsyncResult;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
@ -28,6 +29,7 @@ import static cn.iocoder.yudao.module.system.dal.dataobject.logger.OperateLogDO.
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
@Slf4j
|
||||
public class OperateLogServiceImpl implements OperateLogService {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user