|
@@ -21,9 +21,6 @@ public class PermissionFilter extends AccessControlFilter {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ShiroFilterUtils shiroFilterUtils;
|
|
private ShiroFilterUtils shiroFilterUtils;
|
|
|
-
|
|
|
|
|
- @Value("app.mobile.website")
|
|
|
|
|
- private String mobileWebsite;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue)
|
|
protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue)
|
|
@@ -48,10 +45,7 @@ public class PermissionFilter extends AccessControlFilter {
|
|
|
@Override
|
|
@Override
|
|
|
protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {
|
|
protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception {
|
|
|
Subject subject = getSubject(request, response);
|
|
Subject subject = getSubject(request, response);
|
|
|
- if (shiroFilterUtils.isMobileDevice((HttpServletRequest)request) || request.getServerName().indexOf("m.") > 0){
|
|
|
|
|
- LoggerUtils.debug(getClass(), "当前访问为移动设备");
|
|
|
|
|
- WebUtils.issueRedirect(request, response, mobileWebsite);
|
|
|
|
|
- }else if (shiroFilterUtils.isAjax((HttpServletRequest) request)) {
|
|
|
|
|
|
|
+ if (shiroFilterUtils.isAjax((HttpServletRequest) request)) {
|
|
|
LoggerUtils.debug(getClass(), "当前用户权限不够,并且是Ajax请求!");
|
|
LoggerUtils.debug(getClass(), "当前用户权限不够,并且是Ajax请求!");
|
|
|
shiroFilterUtils.out((HttpServletResponse) response, new Result().error(new Error("", "403", "当前用户权限不够!")));
|
|
shiroFilterUtils.out((HttpServletResponse) response, new Result().error(new Error("", "403", "当前用户权限不够!")));
|
|
|
} else if (null == subject.getPrincipal()) {
|
|
} else if (null == subject.getPrincipal()) {
|