Commit e9356514 by guojuxing

权限过滤修改

parent 5689a61c
......@@ -8,6 +8,7 @@ import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.exception.CommonException;
import com.gic.enterprise.utils.UserDetail;
import com.gic.enterprise.utils.UserDetailUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.dubbo.rpc.RpcContext;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -40,6 +41,8 @@ public class AuthInterceptor extends HandlerInterceptorAdapter {
//获取uri
String uri = request.getRequestURI();
String isControl = request.getParameter("isControl");
log.info("用户接口访问标志:{}", isControl);
log.info("用户接口访问路由:{}", uri);
//不需要拦截的路径
if (ignoreUriBeforeLoginMap.containsKey(uri)) {
......@@ -64,6 +67,15 @@ public class AuthInterceptor extends HandlerInterceptorAdapter {
if (menuUrlMap == null || menuUrlMap.isEmpty()) {
throw new CommonException(ErrorCode.SYSTEM_ERROR.getErrorCode(), "sorry,您无该页面的访问权限,请联系超级管理员!");
}
if (StringUtils.isNotBlank(isControl)) {
//说明是操作项
//如果匹配上了,说明是没权限
if (menuUrlMap.containsKey(uri)) {
throw new CommonException(ErrorCode.SYSTEM_ERROR.getErrorCode(), "sorry,您无该页面的访问权限,请联系超级管理员!");
}
}
//说明是页面
//如果没有匹配上,说明没权限
if (!menuUrlMap.containsKey(uri)) {
throw new CommonException(ErrorCode.SYSTEM_ERROR.getErrorCode(), "sorry,您无该页面的访问权限,请联系超级管理员!");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment