mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-26 09:11:52 +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.ArrayUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.extra.servlet.ServletUtil;
|
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.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||||
import cn.iocoder.yudao.framework.operatelog.core.dto.OperateLogCreateReqDTO;
|
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 {
|
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();
|
Date startTime = new Date();
|
||||||
try {
|
try {
|
||||||
|
@ -10,8 +10,8 @@ import org.springframework.security.config.annotation.web.configurers.Expression
|
|||||||
/**
|
/**
|
||||||
* Infra 模块的 Security 配置
|
* Infra 模块的 Security 配置
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration("infraSecurityConfiguration")
|
||||||
public class InfraSecurityConfiguration {
|
public class SecurityConfiguration {
|
||||||
|
|
||||||
@Value("${spring.boot.admin.context-path:''}")
|
@Value("${spring.boot.admin.context-path:''}")
|
||||||
private String adminSeverContextPath;
|
private String adminSeverContextPath;
|
@ -1,11 +1,14 @@
|
|||||||
### 请求 /member/user/profile/get 接口 => 没有权限
|
### 请求 /member/user/profile/get 接口 => 没有权限
|
||||||
GET {{userServerUrl}}/member/user/profile/get
|
GET {{appApi}}/member/user/get
|
||||||
Authorization: Bearer test245
|
Authorization: Bearer test245
|
||||||
|
tenant-id: {{appTenentId}}
|
||||||
|
|
||||||
### 请求 /member/user/profile/revise-nickname 接口 成功
|
### 请求 /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
|
Authorization: Bearer test245
|
||||||
|
tenant-id: {{appTenentId}}
|
||||||
|
|
||||||
### 请求 /member/user/profile/get-user-info 接口 成功
|
### 请求 /member/user/get-user-info 接口 成功
|
||||||
GET {{userServerUrl}}/member/user/profile/get-user-info?id=245
|
GET {{appApi}}/member/user/get-user-info?id=245
|
||||||
Authorization: Bearer test245
|
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 cn.iocoder.yudao.framework.redis.core.RedisKeyDefine;
|
||||||
import org.redisson.api.RLock;
|
import org.redisson.api.RLock;
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.redis.core.RedisKeyDefine.KeyTypeEnum.HASH;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付 Redis Key 枚举类
|
* 支付 Redis Key 枚举类
|
||||||
*
|
*
|
||||||
* @author 芋道源码
|
* @author 芋道源码
|
||||||
*/
|
*/
|
||||||
public interface PayRedisKeyCoreConstants {
|
public interface RedisKeyConstants {
|
||||||
|
|
||||||
RedisKeyDefine PAY_NOTIFY_LOCK = new RedisKeyDefine("通知任务的分布式锁",
|
RedisKeyDefine PAY_NOTIFY_LOCK = new RedisKeyDefine("通知任务的分布式锁",
|
||||||
"pay_notify:lock:", // 参数来自 DefaultLockKeyBuilder 类
|
"pay_notify:lock:", // 参数来自 DefaultLockKeyBuilder 类
|
@ -7,7 +7,7 @@ import org.springframework.stereotype.Repository;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.concurrent.TimeUnit;
|
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
|
* 支付通知的锁 Redis DAO
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.system.dal.dataobject.logger;
|
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.common.pojo.CommonResult;
|
||||||
import cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum;
|
import cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum;
|
||||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
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;
|
private Long userId;
|
||||||
|
/**
|
||||||
|
* 用户类型
|
||||||
|
*
|
||||||
|
* 关联 {@link UserTypeEnum}
|
||||||
|
*/
|
||||||
|
private Integer userType;
|
||||||
/**
|
/**
|
||||||
* 操作模块
|
* 操作模块
|
||||||
*/
|
*/
|
||||||
|
@ -27,7 +27,7 @@ public interface RedisKeyConstants {
|
|||||||
"social_auth_user:%d:%s", // 参数为 type,code
|
"social_auth_user:%d:%s", // 参数为 type,code
|
||||||
STRING, AuthUser.class, Duration.ofDays(1));
|
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
|
"social_auth_state:%s", // 参数为 state
|
||||||
STRING, String.class, Duration.ofHours(24)); // 值为 state
|
STRING, String.class, Duration.ofHours(24)); // 值为 state
|
||||||
|
|
||||||
|
@ -9,8 +9,8 @@ import org.springframework.security.config.annotation.web.configurers.Expression
|
|||||||
/**
|
/**
|
||||||
* System 模块的 Security 配置
|
* System 模块的 Security 配置
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration("systemSecurityConfiguration")
|
||||||
public class SystemSecurityConfiguration {
|
public class SecurityConfiguration {
|
||||||
|
|
||||||
@Bean("systemAuthorizeRequestsCustomizer")
|
@Bean("systemAuthorizeRequestsCustomizer")
|
||||||
public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() {
|
public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() {
|
@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.scheduling.annotation.AsyncResult;
|
import org.springframework.scheduling.annotation.AsyncResult;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Collection;
|
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;
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
@Validated
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class OperateLogServiceImpl implements OperateLogService {
|
public class OperateLogServiceImpl implements OperateLogService {
|
||||||
|
|
||||||
|
2
更新日志.md
2
更新日志.md
@ -10,8 +10,8 @@
|
|||||||
* 用户前台的社交登陆
|
* 用户前台的社交登陆
|
||||||
* 用户前台的修改手机、修改密码、忘记密码
|
* 用户前台的修改手机、修改密码、忘记密码
|
||||||
* 升级 mybatis plus 最新版本,优化多租户的实现
|
* 升级 mybatis plus 最新版本,优化多租户的实现
|
||||||
|
* RedisKeyDefine 的发现机制
|
||||||
|
|
||||||
*【优化】操作日志新增用户类型,实现 APP 端的 API 的操作日志的记录
|
|
||||||
*【修复】管理后台 UI 超时登录后,返回登陆界面时,由于未登陆加载不到字典数据,导致报错的问题
|
*【修复】管理后台 UI 超时登录后,返回登陆界面时,由于未登陆加载不到字典数据,导致报错的问题
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user