From a0c41623f2536af5edcaa5128610d57fd5ec63d7 Mon Sep 17 00:00:00 2001 From: Awen <39176130+yu1183688986@users.noreply.github.com> Date: Fri, 18 Mar 2022 10:20:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=9A=E7=A7=9F=E6=88=B7-?= =?UTF-8?q?=E7=A7=9F=E6=88=B7=E5=A5=97=E9=A4=90=E6=9C=AA=E5=8F=8A=E6=97=B6?= =?UTF-8?q?=E7=94=9F=E6=95=88=E7=9A=84bug=E8=A7=81https://gitee.com/zhijia?= =?UTF-8?q?ntianya/ruoyi-vue-pro/issues/I4WARM#git-comment-divider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/system/service/permission/RoleServiceImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceImpl.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceImpl.java index ebea1f88c..16e584964 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceImpl.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/service/permission/RoleServiceImpl.java @@ -136,7 +136,12 @@ public class RoleServiceImpl implements RoleService { role.setDataScope(DataScopeEnum.ALL.getScope()); // 默认可查看所有数据。原因是,可能一些项目不需要项目权限 roleMapper.insert(role); // 发送刷新消息 - roleProducer.sendRoleRefreshMessage(); + TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { + @Override + public void afterCommit() { + roleProducer.sendRoleRefreshMessage(); + } + }); // 返回 return role.getId(); }