From 1a0d4498dd5278eb48ee81822c87cfd1fa010f8b Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Sun, 14 Nov 2021 12:19:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9F=B3=E4=B9=90=E6=92=AD=E6=94=BE=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=96=B0=E5=A2=9E=E5=88=86=E4=BA=AB=E6=8C=89=E9=92=AE?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=E9=9F=B3=E4=B9=90=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=97=B6=E4=BE=9D=E6=97=A7=E5=88=86?= =?UTF-8?q?=E9=85=8Dtoken=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/yutou/tools/nas/NasManager.java | 8 +++++--- web/html/body/nas/music.html | 12 ++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/yutou/tools/nas/NasManager.java b/src/main/java/com/yutou/tools/nas/NasManager.java index 6974aca..69984b7 100644 --- a/src/main/java/com/yutou/tools/nas/NasManager.java +++ b/src/main/java/com/yutou/tools/nas/NasManager.java @@ -189,9 +189,11 @@ public class NasManager { String data=HttpTools.http_post(NasUrl+":8001/nas/music/share.do",json.toJSONString().getBytes(StandardCharsets.UTF_8),1,header); System.out.println("分享:"+data); JSONObject _data=JSONObject.parseObject(data); - RedisTools.set(token,data,3600); - System.out.println("设置分享token:"+token+" -> "+data); - _data.put("token",token); + if(_data.getInteger("code")==1) { + RedisTools.set(token, data, 3600); + System.out.println("设置分享token:" + token + " -> " + data); + _data.put("token", token); + } json.clear(); json.put("code",0); json.put("msg","ok"); diff --git a/web/html/body/nas/music.html b/web/html/body/nas/music.html index 045004c..b673dc2 100644 --- a/web/html/body/nas/music.html +++ b/web/html/body/nas/music.html @@ -27,6 +27,7 @@