Commit 63398bf3d091b93a93b2ea8bebf119fcc47df072

Authored by 芋道源码
Committed by Gitee
2 parents d2075d5c a0c41623

!99 修复-多租户-租户套餐未及时生效的bug

Merge pull request !99 from 清溪先生/master
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,7 +136,12 @@ public class RoleServiceImpl implements RoleService {
136 role.setDataScope(DataScopeEnum.ALL.getScope()); // 默认可查看所有数据。原因是,可能一些项目不需要项目权限 136 role.setDataScope(DataScopeEnum.ALL.getScope()); // 默认可查看所有数据。原因是,可能一些项目不需要项目权限
137 roleMapper.insert(role); 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 return role.getId(); 146 return role.getId();
142 } 147 }