Browse Source

Merge pull request #1014 in DESIGN/design from ~LANLAN/design:bugfix/10.0 to bugfix/10.0

* commit '12add7ab4612c7bcf97939fd6f7d31ac7652058e':
  REPORT-20303 FR中点击插件管理报错闪退
bugfix/10.0
Lanlan 5 years ago
parent
commit
f2d6474cd9
  1. 8
      designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java

8
designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java

@ -12,6 +12,7 @@ import com.fr.general.IOUtils;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.general.http.HttpToolbox;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.PluginStoreConstants; import com.fr.plugin.PluginStoreConstants;
@ -301,10 +302,9 @@ public class WebViewDlgHelper {
new SwingWorker<Void, Void>() { new SwingWorker<Void, Void>() {
@Override @Override
protected Void doInBackground() throws Exception { protected Void doInBackground() throws Exception {
HttpClient httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("shop.plugin.update") + "?" + PluginUtils.FR_VERSION + "=" + ProductConstants.VERSION + "&version=" + PluginStoreConstants.getInstance().getProps("VERSION")); String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.update");
httpClient.asGet(); if (url != null) {
if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) { String text = HttpToolbox.get(url + "?" + PluginUtils.FR_VERSION + "=" + ProductConstants.VERSION + "&version=" + PluginStoreConstants.getInstance().getProps("VERSION"));
String text = httpClient.getResponseText();
JSONObject resultJSONObject = new JSONObject(text); JSONObject resultJSONObject = new JSONObject(text);
String isLatest = resultJSONObject.optString("result"); String isLatest = resultJSONObject.optString("result");
if (!ComparatorUtils.equals(isLatest, LATEST)) { if (!ComparatorUtils.equals(isLatest, LATEST)) {

Loading…
Cancel
Save