diff --git a/src/main/java/com/yutou/tools/ToolsApplication.java b/src/main/java/com/yutou/tools/ToolsApplication.java index c97ad19..6548c04 100644 --- a/src/main/java/com/yutou/tools/ToolsApplication.java +++ b/src/main/java/com/yutou/tools/ToolsApplication.java @@ -5,7 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class ToolsApplication { - public static final String version="1.4"; + public static final String version="1.4.1"; public static void main(String[] args) { System.out.println("当前版本号:" + version); diff --git a/src/main/java/com/yutou/tools/nas/NasManager.java b/src/main/java/com/yutou/tools/nas/NasManager.java index 69984b7..9a1b3d9 100644 --- a/src/main/java/com/yutou/tools/nas/NasManager.java +++ b/src/main/java/com/yutou/tools/nas/NasManager.java @@ -186,8 +186,11 @@ public class NasManager { json.put("file",file); HashMap header=new HashMap<>(); header.put("content-type","application/json"); - String data=HttpTools.http_post(NasUrl+":8001/nas/music/share.do",json.toJSONString().getBytes(StandardCharsets.UTF_8),1,header); - System.out.println("分享:"+data); + String url=NasUrl+":8001"; + if(UpdateIp.nas_ip!=null){ + url="http://"+UpdateIp.nas_ip+":8000"; + } + String data=HttpTools.http_post(url+"/nas/music/share.do",json.toJSONString().getBytes(StandardCharsets.UTF_8),1,header); JSONObject _data=JSONObject.parseObject(data); if(_data.getInteger("code")==1) { RedisTools.set(token, data, 3600); @@ -206,7 +209,11 @@ public class NasManager { JSONObject json=new JSONObject(); String redis=RedisTools.get(share); if(redis!=null&&!"-999".equals(redis)) { - String _json=HttpTools.get(NasUrl+":8001/nas/music/playShare.do?token="+JSONObject.parseObject(redis).getJSONObject("data").getString("share")); + String url=NasUrl+":8001"; + if(UpdateIp.nas_ip!=null){ + url="http://"+UpdateIp.nas_ip+":8000"; + } + String _json=HttpTools.get(url+"/nas/music/playShare.do?token="+JSONObject.parseObject(redis).getJSONObject("data").getString("share")); System.out.println(_json); JSONObject item=JSONObject.parseObject(_json); if(item.getInteger("code")==0) {