Browse Source

原先的判断网络断开的逻辑,用swingworker搜索的时候,偶现性的会卡住。

final/10.0
alex.sung 6 years ago
parent
commit
7452f05304
  1. 8
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java

8
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java

@ -22,9 +22,6 @@ import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import com.fr.json.JSONUtils;
import com.fr.stable.StringUtils;
import com.fr.third.org.apache.http.HttpStatus;
import com.fr.third.org.apache.http.StatusLine;
import com.fr.third.org.apache.http.client.methods.HttpGet;
import java.util.List;
@ -159,10 +156,9 @@ public class AlphaFineHelper {
* @return
*/
public static boolean isNetworkOk(){
HttpGet getHelp = new HttpGet(URL_FOR_TEST_NETWORK);
try {
StatusLine statusLine = HttpToolbox.getHttpClient(URL_FOR_TEST_NETWORK).execute(getHelp).getStatusLine();
return statusLine.getStatusCode() == HttpStatus.SC_OK;
HttpToolbox.get(URL_FOR_TEST_NETWORK);
return true;
} catch (Exception ignore) {
// 网络异常
return false;

Loading…
Cancel
Save