修改注释

master
星期八 5 years ago
parent 39aed717c8
commit dc5f65a349
  1. 2
      src/main/java/com/lq/cms/mode/Ztree.java
  2. 2
      src/main/java/com/lq/cms/mode/ZtreeItem.java
  3. 4
      src/main/java/com/lq/code/interceptor/PageInteceptor.java
  4. 3
      src/main/java/com/lq/code/interceptor/shiro/ShiroRealm.java
  5. 27
      src/main/java/com/lq/webUtil/util/IPUtil.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 {

@ -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{

@ -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();

@ -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 {

@ -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);

Loading…
Cancel
Save