Commit d46097a65856b8dfebe675870b7e341b3cc6263f
1 parent
d78b6d8b
【修复】SYSTEM:更新角色时,记录修改内容
Showing
1 changed file
with
3 additions
and
1 deletions
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceImpl.java
| ... | ... | @@ -18,7 +18,9 @@ import cn.iocoder.yudao.module.system.enums.permission.RoleCodeEnum; |
| 18 | 18 | import cn.iocoder.yudao.module.system.enums.permission.RoleTypeEnum; |
| 19 | 19 | import com.google.common.annotations.VisibleForTesting; |
| 20 | 20 | import com.mzt.logapi.context.LogRecordContext; |
| 21 | +import com.mzt.logapi.service.impl.DiffParseFunction; | |
| 21 | 22 | import com.mzt.logapi.starter.annotation.LogRecord; |
| 23 | +import jakarta.annotation.Resource; | |
| 22 | 24 | import lombok.extern.slf4j.Slf4j; |
| 23 | 25 | import org.springframework.cache.annotation.CacheEvict; |
| 24 | 26 | import org.springframework.cache.annotation.Cacheable; |
| ... | ... | @@ -26,7 +28,6 @@ import org.springframework.stereotype.Service; |
| 26 | 28 | import org.springframework.transaction.annotation.Transactional; |
| 27 | 29 | import org.springframework.util.StringUtils; |
| 28 | 30 | |
| 29 | -import jakarta.annotation.Resource; | |
| 30 | 31 | import java.util.*; |
| 31 | 32 | |
| 32 | 33 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| ... | ... | @@ -116,6 +117,7 @@ public class RoleServiceImpl implements RoleService { |
| 116 | 117 | permissionService.processRoleDeleted(id); |
| 117 | 118 | |
| 118 | 119 | // 3. 记录操作日志上下文 |
| 120 | + LogRecordContext.putVariable(DiffParseFunction.OLD_OBJECT, BeanUtils.toBean(role, RoleSaveReqVO.class)); | |
| 119 | 121 | LogRecordContext.putVariable("role", role); |
| 120 | 122 | } |
| 121 | 123 | ... | ... |