diff --git a/src/main/java/com/fantaibao/page/PlatformSelectionView.java b/src/main/java/com/fantaibao/page/PlatformSelectionView.java index 8bead79..51a57f0 100644 --- a/src/main/java/com/fantaibao/page/PlatformSelectionView.java +++ b/src/main/java/com/fantaibao/page/PlatformSelectionView.java @@ -14,6 +14,7 @@ import javafx.scene.image.ImageView; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import javafx.stage.Stage; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; public class PlatformSelectionView { @@ -93,10 +94,11 @@ public class PlatformSelectionView { connectButton.setOnAction(event -> { FtbCrawlNetBase ftbCrawlNetMt = SpringContext.getBean("ftbCrawlNetMt"); - ftbCrawlNetMt.executeCookieIntercept(); - + ThreadPoolTaskExecutor poolTaskExecutor = SpringContext.getBean(ThreadPoolTaskExecutor.class); + poolTaskExecutor.execute(() -> { + ftbCrawlNetMt.executeCookieIntercept(); + }); }); - option.getChildren().addAll(imageView, titleLabel, connectButton); return option; @@ -122,8 +124,10 @@ public class PlatformSelectionView { connectButton.setOnAction(event -> { FtbCrawlNetBase ftbCrawlNetMt = SpringContext.getBean("ftbCrawlNetDy"); - ftbCrawlNetMt.executeCookieIntercept(); - + ThreadPoolTaskExecutor poolTaskExecutor = SpringContext.getBean(ThreadPoolTaskExecutor.class); + poolTaskExecutor.execute(() -> { + ftbCrawlNetMt.executeCookieIntercept(); + }); }); option.getChildren().addAll(imageView, titleLabel, connectButton);