Commit a0c41623f2536af5edcaa5128610d57fd5ec63d7

Authored by Awen
1 parent d2075d5c

修复多租户-租户套餐未及时生效的bug见https://gitee.com/zhijiantianya/ruoyi-vue-pro/issues/I4WARM#git-comment-divider

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 }
... ...