Преглед на файлове

修改移动网站地址

wanghui преди 7 години
родител
ревизия
7da535a0b2

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

@@ -48,7 +48,7 @@ public class PermissionFilter extends AccessControlFilter {
 	@Override
 	protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {
 		Subject subject = getSubject(request, response);
-		if (shiroFilterUtils.isMobileDevice((HttpServletRequest)request)){
+		if (shiroFilterUtils.isMobileDevice((HttpServletRequest)request) || request.getServerName().indexOf("m.") > 0){
 			LoggerUtils.debug(getClass(), "当前访问为移动设备");
 			WebUtils.issueRedirect(request, response, mobileWebsite);
 		}else if (shiroFilterUtils.isAjax((HttpServletRequest) request)) {

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

@@ -38,7 +38,7 @@ public class ShiroFilterUtils {
 	 * @return
 	 */
 	public boolean isMobileDevice(HttpServletRequest request) {
-		String[] deviceArray = new String[]{"android","mac os","windows phone"};
+		String[] deviceArray = new String[]{"android","blackBerry","windows phone","iphone","ipod","ipad"};
         if(request.getHeader("User-Agent") != null){
         	String agent = request.getHeader("User-Agent");
         	for(int i = 0; i<deviceArray.length; i++){

+ 1 - 1
src/main/resources/props/config_local.properties

@@ -52,7 +52,7 @@ session.timeout=12000000
 session.validate.timespan=18000000
 
 app.name=AFT
-app.mobile.website=m.jishutao.com
+app.mobile.website=m.kedexinxi.com
 template.cacheable=false
 
 static.host=//sclient.jishutao.com/client/1.0.0

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -53,7 +53,7 @@ session.timeout=12000000
 session.validate.timespan=18000000
 
 app.name=AFT
-app.mobile.website=m.jishutao.com
+app.mobile.website=m.kedexinxi.com
 template.cacheable=false
 
 static.host=//statics.jishutao.com/client/1.0.0