From f4cabd1155e3c1548c7172f863b8b27db1ef888a Mon Sep 17 00:00:00 2001 From: yutou Date: Tue, 23 Feb 2021 11:16:56 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=A8=8D=E5=BE=AE=E9=80=82?= =?UTF-8?q?=E9=85=8D=E4=B8=8B=E7=A7=BB=E5=8A=A8=E7=AB=AF=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=99=BB=E9=99=86=E9=AA=8C=E8=AF=81=E7=A0=81=E4=B8=80?= =?UTF-8?q?=E5=88=86=E9=92=9F=E5=86=85=E5=8F=AA=E8=83=BD=E5=B0=9D=E8=AF=95?= =?UTF-8?q?=E4=B8=89=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yutou/tools/ToolsApplication.java | 2 +- .../com/yutou/tools/web/userController.java | 16 +++- web/html/body/nas/bilidown.html | 2 +- web/html/body/nas/music.html | 2 +- web/html/body/nas/side.html | 21 +++-- web/html/header.html | 93 ++++++++++--------- 6 files changed, 77 insertions(+), 59 deletions(-) diff --git a/src/main/java/com/yutou/tools/ToolsApplication.java b/src/main/java/com/yutou/tools/ToolsApplication.java index fb8452e..591a6b4 100644 --- a/src/main/java/com/yutou/tools/ToolsApplication.java +++ b/src/main/java/com/yutou/tools/ToolsApplication.java @@ -9,7 +9,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class ToolsApplication { - public static final String version="1.0.17"; + public static final String version="1.0.18"; public static void main(String[] args) { System.out.println("当前版本号:"+version); diff --git a/src/main/java/com/yutou/tools/web/userController.java b/src/main/java/com/yutou/tools/web/userController.java index f030953..188bfe7 100644 --- a/src/main/java/com/yutou/tools/web/userController.java +++ b/src/main/java/com/yutou/tools/web/userController.java @@ -124,8 +124,22 @@ public class userController { @RequestMapping(value = "/login/login.do", method = RequestMethod.POST) @ResponseBody - public String login(HttpServletResponse response, String code) { + public String login(HttpServletRequest request,HttpServletResponse response, String code) { JSONObject json = new JSONObject(); + String ip=Tools.getRemoteAddress(request); + if(RedisTools.get(ip)==null||"-999".equals(ip)){ + RedisTools.set(ip,"1",60); + }else{ + int i=Integer.parseInt(RedisTools.get(ip)); + if(i!=3){ + i++; + RedisTools.set(ip,i+"",60); + }else{ + json.put("code", -2); + json.put("msg", "请求频繁,请稍后再试"); + return json.toJSONString(); + } + } String secret= (String) ConfigTools.load(ConfigTools.DATA,"secret"); if(StringUtils.isEmpty(secret)){ secret= (String) ConfigTools.load(ConfigTools.DATA,"secret_tmp"); diff --git a/web/html/body/nas/bilidown.html b/web/html/body/nas/bilidown.html index 34f7165..fc73e80 100644 --- a/web/html/body/nas/bilidown.html +++ b/web/html/body/nas/bilidown.html @@ -32,7 +32,7 @@ $('#side').load("/html/body/nas/side.html"); $.get("/login/check.do", function (data) { let json = JSON.parse(data); - if (json.code != 0) { + if (json.code !== 0) { window.location.href = "/" } }) diff --git a/web/html/body/nas/music.html b/web/html/body/nas/music.html index 9d31081..d01b158 100644 --- a/web/html/body/nas/music.html +++ b/web/html/body/nas/music.html @@ -12,7 +12,7 @@
-
+
diff --git a/web/html/body/nas/side.html b/web/html/body/nas/side.html index 81b232e..e87475c 100644 --- a/web/html/body/nas/side.html +++ b/web/html/body/nas/side.html @@ -1,7 +1,7 @@
-
+
-
\ No newline at end of file diff --git a/web/html/header.html b/web/html/header.html index f6fe993..a82028a 100644 --- a/web/html/header.html +++ b/web/html/header.html @@ -7,39 +7,39 @@ -