新增菜单导航显示风格(default为左侧导航菜单,topnav为顶部导航菜单)
This commit is contained in:
@ -16,6 +16,11 @@ import com.ruoyi.common.core.text.Convert;
|
||||
*/
|
||||
public class ServletUtils
|
||||
{
|
||||
/**
|
||||
* 定义移动端请求的所有可能类型
|
||||
*/
|
||||
private final static String[] agent = { "Android", "iPhone", "iPod", "iPad", "Windows Phone", "MQQBrowser" };
|
||||
|
||||
/**
|
||||
* 获取String参数
|
||||
*/
|
||||
@ -132,4 +137,28 @@ public class ServletUtils
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断User-Agent 是不是来自于手机
|
||||
*/
|
||||
public static boolean checkAgentIsMobile(String ua)
|
||||
{
|
||||
boolean flag = false;
|
||||
if (!ua.contains("Windows NT") || (ua.contains("Windows NT") && ua.contains("compatible; MSIE 9.0;")))
|
||||
{
|
||||
// 排除 苹果桌面系统
|
||||
if (!ua.contains("Windows NT") && !ua.contains("Macintosh"))
|
||||
{
|
||||
for (String item : agent)
|
||||
{
|
||||
if (ua.contains(item))
|
||||
{
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user