Browse Source

Pull request #15851: REPORT-144358 fix: 修复设计器启动取消注册模块失败问题

Merge in DESIGN/design from ~ANNER/design:fbp/release to fbp/release

* commit 'ef18ddf8c855beb8c5e4be31f59001c2e8693a3c':
  REPORT-144358 fix: 修复设计器启动取消注册模块失败问题
fbp/release
Anner-王敬松 3 months ago
parent
commit
3fed3bd46d
  1. 14
      designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java

14
designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java

@ -1,10 +1,13 @@
package com.fanruan.boot.adaptation;
import com.fanruan.carina.Carina;
import com.fanruan.carina.context.ContextListener;
import com.fanruan.carina.event.CarinaLifecycleEvent;
import com.fanruan.portal.authority.PortalAuthorityItems;
import com.fanruan.portal.module.PortalModule;
import com.fanruan.portal.module.PortalModuleManager;
import com.fr.event.Event;
import com.fr.event.EventDispatcher;
import com.fr.event.Listener;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils;
import com.fr.third.guava.collect.Sets;
@ -94,14 +97,17 @@ public class DesignServerSupportModule {
* 启动入口重建一下展示的module
*/
public static void rebuild() {
Carina.getApplicationContext().addListener(new ContextListener() {
EventDispatcher.listen(CarinaLifecycleEvent.AFTER_START, new Listener() {
@Override
public void onStart() {
public void on(Event event, Object o) {
FineLoggerFactory.getLogger().info("start unregister module for embed design server");
PortalModuleManager.allModules().values().stream()
.filter(m -> !StringUtils.equals(m.getParentID(), PortalAuthorityItems.PORTAL_ROOT_ID))
.map(PortalModule::getId)
.filter(m -> !SUPPORT_MODULE.contains(m))
.forEach(PortalModuleManager::unregister);
FineLoggerFactory.getLogger().info("unregister module for embed design server done");
}
});
}

Loading…
Cancel
Save