Commit e5f7b010e2b122f5372b60491f01f080643ce467
Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/1.6.1
Showing
1 changed file
with
6 additions
and
1 deletions
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 { |
| 136 | 136 | role.setDataScope(DataScopeEnum.ALL.getScope()); // 默认可查看所有数据。原因是,可能一些项目不需要项目权限 |
| 137 | 137 | roleMapper.insert(role); |
| 138 | 138 | // 发送刷新消息 |
| 139 | - roleProducer.sendRoleRefreshMessage(); | |
| 139 | + TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { | |
| 140 | + @Override | |
| 141 | + public void afterCommit() { | |
| 142 | + roleProducer.sendRoleRefreshMessage(); | |
| 143 | + } | |
| 144 | + }); | |
| 140 | 145 | // 返回 |
| 141 | 146 | return role.getId(); |
| 142 | 147 | } | ... | ... |