diff --git a/app/src/main/java/com/yutou/nas_music_player/tools/NetworkTool.java b/app/src/main/java/com/yutou/nas_music_player/tools/NetworkTool.java index 85b4b8e..317f539 100644 --- a/app/src/main/java/com/yutou/nas_music_player/tools/NetworkTool.java +++ b/app/src/main/java/com/yutou/nas_music_player/tools/NetworkTool.java @@ -26,6 +26,7 @@ import java.util.Map; import java.util.Set; import static com.yutou.nas_music_player.tools.NetworkTool.NetworkAPI.HOME; +import static com.yutou.nas_music_player.tools.NetworkTool.NetworkAPI.HTTP_KEY; public class NetworkTool { @@ -67,7 +68,7 @@ public class NetworkTool { @Override public void httpError(Exception e) { System.out.println("局域网不在线,走互联网"); - httpGet("http://tools.yutou233.cn/nas/music/getlocalhost.do", new JSONObject(), new NetworkInterface() { + httpGet("http://tools.yutou233.cn/nas/music/getlocalhost.do?token="+HTTP_KEY, new JSONObject(), new NetworkInterface() { @Override public void httpGetData(Object data, int state) { try { @@ -228,9 +229,7 @@ public class NetworkTool { final String finalStr = str.toString(); // Log.i(TAG + "[" + url + "?" + toGetSplice(body) + "]", "body:" + str + " (" + connection.getResponseCode() + ")"); - if (map.containsKey(body)) { - map.remove(body); - } + map.remove(body); AppData.handler.post(new Runnable() { @Override public void run() {