瀏覽代碼

修改移动端判断

wanghui 7 年之前
父節點
當前提交
d8f4b7467c
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/main/java/com/goafanti/core/shiro/filter/DeviceFilter.java

+ 1 - 1
src/main/java/com/goafanti/core/shiro/filter/DeviceFilter.java

@@ -23,7 +23,7 @@ public class DeviceFilter extends  AccessControlFilter{
 	@Override
 	protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue)
 			throws Exception {
-		if (shiroFilterUtils.isMobileDevice((HttpServletRequest)request) || request.getServerName().indexOf("m.") > 0){
+		if (shiroFilterUtils.isMobileDevice((HttpServletRequest)request) || request.getServerName().startsWith("m.")){
 			return false;
 		}
 		return true;