From fe2bc8812a5694b3ba4c6c2b25b8751c408b7b3d Mon Sep 17 00:00:00 2001 From: yutou Date: Tue, 22 Dec 2020 18:08:14 +0800 Subject: [PATCH] update --- .../java/com/yutou/nas_music_player/tools/NetworkTool.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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() {