Browse Source

REPORT-62780【阻塞】【接触点优化】收起筛选面板,开始轮播加载时,最新版本会提示网络连接失败导致无法正常轮播

feature/x
kerry 3 years ago
parent
commit
f81fc8d004
  1. 11
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/OnlineEmbedFilterSelectPane.java

11
designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/OnlineEmbedFilterSelectPane.java

@ -7,9 +7,13 @@ import com.fr.design.mainframe.share.ui.online.CarouselStateManger;
import com.fr.design.mainframe.share.ui.widgetfilter.FilterPane;
import com.fr.form.share.base.DataLoad;
import com.fr.form.share.bean.OnlineShareWidget;
import com.fr.form.share.constants.ShareComponentConstants;
import com.fr.form.share.exception.NetWorkFailedException;
import com.fr.general.http.HttpClient;
import com.fr.log.FineLoggerFactory;
import com.fr.module.ModuleContext;
import com.fr.stable.EncodeConstants;
import com.fr.third.springframework.web.util.UriUtils;
import javax.imageio.ImageIO;
import javax.swing.JPanel;
@ -22,6 +26,7 @@ import java.awt.Rectangle;
import java.awt.event.AWTEventListener;
import java.awt.event.MouseEvent;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ScheduledExecutorService;
@ -96,6 +101,12 @@ public class OnlineEmbedFilterSelectPane extends AbstractOnlineWidgetSelectPane
}
private Image getPreviewImage(String url) throws NetWorkFailedException {
try {
url = UriUtils.encodePath(url, EncodeConstants.ENCODING_UTF_8);
} catch (UnsupportedEncodingException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
return ShareComponentConstants.DEFAULT_COVER;
}
HttpClient httpClient = new HttpClient(url);
httpClient.setTimeout(CAROUSE_IMAGE_LOAD_TIMEOUT);
httpClient.asGet();

Loading…
Cancel
Save