Selaa lähdekoodia

!1196 修复角色更新时,记录的操作日志将更新前的数据记录为空的问题
* 修复角色更新时,记录的操作日志将更新前的数据记录为空的问题

Dincat 6 kuukautta sitten
vanhempi
sitoutus
dcf55c3533

+ 1 - 1
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceImpl.java

@@ -86,6 +86,7 @@ public class RoleServiceImpl implements RoleService {
         roleMapper.updateById(updateObj);
 
         // 3. 记录操作日志上下文
+        LogRecordContext.putVariable(DiffParseFunction.OLD_OBJECT, BeanUtils.toBean(role, RoleSaveReqVO.class));
         LogRecordContext.putVariable("role", role);
     }
 
@@ -118,7 +119,6 @@ public class RoleServiceImpl implements RoleService {
         permissionService.processRoleDeleted(id);
 
         // 3. 记录操作日志上下文
-        LogRecordContext.putVariable(DiffParseFunction.OLD_OBJECT, BeanUtils.toBean(role, RoleSaveReqVO.class));
         LogRecordContext.putVariable("role", role);
     }