anderx лет назад: 7
Родитель
Сommit
20717b57aa

+ 1 - 1
GeneratorConfig.xml

@@ -12,4 +12,4 @@
    <javaClientGenerator targetPackage="com.goafanti.common.dao" targetProject="jitao-server" type="XMLMAPPER" />
    <table schema="aft" tableName="banners"/>
   </context>
-</generatorConfiguration>
+</generatorConfiguration>

+ 2 - 2
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().startsWith("m.")){
+		if (shiroFilterUtils.isMobileDevice((HttpServletRequest)request) || !request.getServerName().startsWith("m")){
 			return false;
 		}
 		return true;
@@ -31,7 +31,7 @@ public class DeviceFilter extends  AccessControlFilter{
 
 	@Override
 	protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {
-		if (shiroFilterUtils.isMobileDevice((HttpServletRequest)request) || request.getServerName().startsWith("m.")){
+		if (shiroFilterUtils.isMobileDevice((HttpServletRequest)request) || !request.getServerName().startsWith("m")){
 			LoggerUtils.debug(getClass(), "当前访问为移动设备");
 			WebUtils.issueRedirect(request, response, mobileWebsite,null,false);
 		}

+ 2 - 2
src/main/resources/shiro_base_auth.ini

@@ -1,5 +1,5 @@
 [base_auth]
-/=anon
+/=device
 /index=anon
 /login=anon
 /user/login.html=anon
@@ -16,7 +16,7 @@
 /open/**=anon
 /favicon.ico=anon
 /static/**=anon
-/portal/**=anon
+/portal/**=device
 /api/portal/**=anon
 /api/admin/**=admin
 /api/user/**=login

+ 2 - 2
src/main/resources/spring/spring-shiro.xml

@@ -160,9 +160,9 @@
 						<property name="loginUrl" value="/admin/login" />
 					</bean>
 				</entry>
-				<!-- <entry key="device">
+				<entry key="device">
 					<bean id="device" class="com.goafanti.core.shiro.filter.DeviceFilter"></bean>
-				</entry> -->
+				</entry>
 			</util:map>
 		</property>
 	</bean>