From dc5f65a3497c8d50d4bdd3ea10cc1110f69d1946 Mon Sep 17 00:00:00 2001 From: qi Date: Mon, 11 May 2020 20:56:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/lq/cms/mode/Ztree.java | 2 +- src/main/java/com/lq/cms/mode/ZtreeItem.java | 2 +- .../lq/code/interceptor/PageInteceptor.java | 4 --- .../lq/code/interceptor/shiro/ShiroRealm.java | 3 ++- src/main/java/com/lq/webUtil/util/IPUtil.java | 27 +++++++++++++------ 5 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/lq/cms/mode/Ztree.java b/src/main/java/com/lq/cms/mode/Ztree.java index 3c6ff77..36f33d4 100755 --- a/src/main/java/com/lq/cms/mode/Ztree.java +++ b/src/main/java/com/lq/cms/mode/Ztree.java @@ -1,7 +1,7 @@ package com.lq.cms.mode; /** - * Created by qi_liang on 2018/2/3. + * 树 * @author qi */ public class Ztree extends ZtreeComposite { diff --git a/src/main/java/com/lq/cms/mode/ZtreeItem.java b/src/main/java/com/lq/cms/mode/ZtreeItem.java index 6ee6e44..170f989 100755 --- a/src/main/java/com/lq/cms/mode/ZtreeItem.java +++ b/src/main/java/com/lq/cms/mode/ZtreeItem.java @@ -4,7 +4,7 @@ import java.util.ArrayList; import java.util.List; /** - * Created by qi_liang on 2018/2/3. + * 树选项 * @author qi */ public class ZtreeItem extends ZtreeComposite{ diff --git a/src/main/java/com/lq/code/interceptor/PageInteceptor.java b/src/main/java/com/lq/code/interceptor/PageInteceptor.java index 554fbdc..ec4fcdc 100755 --- a/src/main/java/com/lq/code/interceptor/PageInteceptor.java +++ b/src/main/java/com/lq/code/interceptor/PageInteceptor.java @@ -29,7 +29,6 @@ import java.util.Properties; @Signature(type = StatementHandler.class,method = "prepare",args = {Connection.class,Integer.class}) }) public class PageInteceptor implements Interceptor { - /** * 数据库类型 */ @@ -39,8 +38,6 @@ public class PageInteceptor implements Interceptor { */ private String pageSqlId; - - @Override public Object intercept(Invocation invocation) throws Throwable { if (invocation.getTarget() instanceof StatementHandler){ @@ -58,7 +55,6 @@ public class PageInteceptor implements Interceptor { AbstractDbBuiler db = dbBuilerFactory.getSqlBuilder(dialect); String pageSql=db.concatPageSql(sql,pageInterface); metaStatementHandler.setValue("delegate.boundSql.sql",pageSql); - } } return invocation.proceed(); diff --git a/src/main/java/com/lq/code/interceptor/shiro/ShiroRealm.java b/src/main/java/com/lq/code/interceptor/shiro/ShiroRealm.java index 50e5276..87a6c21 100755 --- a/src/main/java/com/lq/code/interceptor/shiro/ShiroRealm.java +++ b/src/main/java/com/lq/code/interceptor/shiro/ShiroRealm.java @@ -20,7 +20,8 @@ import java.util.Iterator; import java.util.List; /** - * Created by qi on 2017-12-5. + * 授权权 + * @author qi */ public class ShiroRealm extends AuthorizingRealm { diff --git a/src/main/java/com/lq/webUtil/util/IPUtil.java b/src/main/java/com/lq/webUtil/util/IPUtil.java index cfb1306..fcac2da 100755 --- a/src/main/java/com/lq/webUtil/util/IPUtil.java +++ b/src/main/java/com/lq/webUtil/util/IPUtil.java @@ -80,6 +80,7 @@ public class IPUtil { // System.out.println(InetAddress.getByName("TEST").getHostAddress()); } + @SuppressWarnings("AlibabaUndefineMagicConstant") public String getUserMessage(HttpServletRequest request){ String browserDetails = request.getHeader("User-Agent"); String userAgent = browserDetails; @@ -108,40 +109,50 @@ public class IPUtil { os = "UnKnown, More-Info: "+userAgent; } //===============Browser=========================== + //noinspection AlibabaUndefineMagicConstant if (user.contains("edge")) { browser=(userAgent.substring(userAgent.indexOf("Edge")).split(" ")[0]).replace("/", "-"); - } else if (user.contains("msie")) + } else //noinspection AlibabaUndefineMagicConstant + if (user.contains("msie")) { String substring=userAgent.substring(userAgent.indexOf("MSIE")).split(";")[0]; browser=substring.split(" ")[0].replace("MSIE", "IE")+"-"+substring.split(" ")[1]; - } else if (user.contains("safari") && user.contains("version")) + } else //noinspection AlibabaUndefineMagicConstant,AlibabaUndefineMagicConstant + if (user.contains("safari") && user.contains("version")) { browser=(userAgent.substring(userAgent.indexOf("Safari")).split(" ")[0]).split("/")[0] + "-" +(userAgent.substring(userAgent.indexOf("Version")).split(" ")[0]).split("/")[1]; - } else if ( user.contains("opr") || user.contains("opera")) + } else //noinspection AlibabaUndefineMagicConstant,AlibabaUndefineMagicConstant + if ( user.contains("opr") || user.contains("opera")) { + //noinspection AlibabaUndefineMagicConstant if(user.contains("opera")){ browser=(userAgent.substring(userAgent.indexOf("Opera")).split(" ")[0]).split("/")[0] +"-"+(userAgent.substring(userAgent.indexOf("Version")).split(" ")[0]).split("/")[1]; - }else if(user.contains("opr")){ + }else //noinspection AlibabaUndefineMagicConstant + if(user.contains("opr")){ browser=((userAgent.substring(userAgent.indexOf("OPR")).split(" ")[0]).replace("/", "-")) .replace("OPR", "Opera"); } - } else if (user.contains("chrome")) + } else //noinspection AlibabaUndefineMagicConstant + if (user.contains("chrome")) { browser=(userAgent.substring(userAgent.indexOf("Chrome")).split(" ")[0]).replace("/", "-"); - } else if ((user.indexOf("mozilla/7.0") > -1) || (user.indexOf("netscape6") != -1) || + } else //noinspection AlibabaUndefineMagicConstant,AlibabaUndefineMagicConstant + if ((user.indexOf("mozilla/7.0") > -1) || (user.indexOf("netscape6") != -1) || (user.indexOf("mozilla/4.7") != -1) || (user.indexOf("mozilla/4.78") != -1) || (user.indexOf("mozilla/4.08") != -1) || (user.indexOf("mozilla/3") != -1) ) { browser = "Netscape-?"; - } else if (user.contains("firefox")) + } else //noinspection AlibabaUndefineMagicConstant + if (user.contains("firefox")) { browser=(userAgent.substring(userAgent.indexOf("Firefox")).split(" ")[0]).replace("/", "-"); - } else if(user.contains("rv")) + } else //noinspection AlibabaUndefineMagicConstant + if(user.contains("rv")) { String IEVersion = (userAgent.substring(userAgent.indexOf("rv")).split(" ")[0]).replace("rv:", "-"); browser="IE" + IEVersion.substring(0,IEVersion.length() - 1);