Browse Source

REPORT-29669 屏蔽网址管理中心开关在关闭后的一些报错

feature/big-screen
vito 5 years ago
parent
commit
39a4c19687
  1. 3
      designer-base/src/main/java/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java
  2. 4
      designer-base/src/main/java/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java
  3. 10
      designer-base/src/main/java/com/fr/design/extra/exe/SearchOnlineExecutor.java

3
designer-base/src/main/java/com/fr/design/extra/exe/GetPluginCategoriesExecutor.java

@ -4,6 +4,7 @@ import com.fr.design.extra.PluginConstants;
import com.fr.design.extra.Process;
import com.fr.general.CloudCenter;
import com.fr.general.http.HttpClient;
import com.fr.stable.StringUtils;
/**
* Created by vito on 16/5/16.
@ -28,7 +29,7 @@ public class GetPluginCategoriesExecutor implements Executor {
@Override
public void run(Process<String> process) {
String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.category");
if (url != null) {
if (StringUtils.isNotEmpty(url)) {
HttpClient httpClient = new HttpClient(url);
result = httpClient.getResponseText();
} else {

4
designer-base/src/main/java/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java

@ -52,7 +52,7 @@ public class GetPluginFromStoreExecutor implements Executor {
@Override
public void run(Process<String> process) {
String plistUrl = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.plist") + "?";
String plistUrl = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.plist");
boolean getRecommend = StringUtils.isEmpty(category) && StringUtils.isEmpty(seller) && StringUtils.isEmpty(fee) && StringUtils.isEmpty(scope);
if (getRecommend) {
result = PluginOperateUtils.getRecommendPlugins();
@ -61,7 +61,7 @@ public class GetPluginFromStoreExecutor implements Executor {
if (StringUtils.isNotBlank(plistUrl)) {
StringBuilder url = new StringBuilder();
url.append(plistUrl);
url.append(plistUrl).append("?");
PluginOperateUtils.dealParams(url, category, seller, fee, scope);
try {
HttpClient httpClient = new HttpClient(url.toString());

10
designer-base/src/main/java/com/fr/design/extra/exe/SearchOnlineExecutor.java

@ -14,8 +14,8 @@ import com.fr.stable.StringUtils;
* Created by vito on 16/4/18.
*/
public class SearchOnlineExecutor implements Executor {
private String result = StringUtils.EMPTY;
private String keyword;
private String result = JSONArray.create().toString();
private final String keyword;
public SearchOnlineExecutor(String keyword) {
this.keyword = keyword;
@ -42,7 +42,11 @@ public class SearchOnlineExecutor implements Executor {
result = PluginOperateUtils.getRecommendPlugins();
return;
}
HttpClient httpClient = new HttpClient(CloudCenter.getInstance().acquireUrlByKind("shop.plugin.store") + "&keyword=" + keyword);
String url = CloudCenter.getInstance().acquireUrlByKind("shop.plugin.store");
if (StringUtils.isEmpty(url)) {
return;
}
HttpClient httpClient = new HttpClient(url + "&keyword=" + keyword);
httpClient.asGet();
String responseText = httpClient.getResponseText();
JSONObject jsonObject = new JSONObject(responseText);

Loading…
Cancel
Save