Commit e5f7b010e2b122f5372b60491f01f080643ce467

Authored by YunaiV
2 parents 813069ab 63398bf3

Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/1.6.1

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 }