Commit b1c04ef9 by guojuxing

用户路由权限

parent 234419be
......@@ -3,9 +3,10 @@ package com.gic.enterprise.interceptor;
import com.alibaba.fastjson.JSON;
import com.gic.enterprise.constants.Constants;
import com.gic.enterprise.context.UserContext;
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 com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIConversion;
import org.apache.dubbo.rpc.RpcContext;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -19,8 +20,7 @@ public class AuthInterceptor extends HandlerInterceptorAdapter {
private static final Logger log = LogManager.getLogger(AuthInterceptor.class);
private String[] ignoreURI = new String[] { "do-login", "do-logout" ,"wechat-auth-callback","get-coupon-list-ignorelogin",
"get-store-widget-store-ignorelogin"};
private String[] ignoreURI = new String[] { "/gic-auth-web/login", "/gic-auth-web/logout"};
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object object) throws Exception {
......@@ -41,10 +41,11 @@ public class AuthInterceptor extends HandlerInterceptorAdapter {
UserDetail userDetail = UserDetailUtils.getUserDetail();
Map<String, Object> menuUrlMap = userDetail.getMenuUrlMap();
if (menuUrlMap == null) {
throw new Exception("sorry,您无该页面的访问权限,请联系超级管理员!");
throw new CommonException(ErrorCode.SYSTEM_ERROR.getErrorCode(), "sorry,您无该页面的访问权限,请联系超级管理员!");
}
if (!menuUrlMap.containsKey(uri)) {
throw new Exception("sorry,您无该页面的访问权限,请联系超级管理员!");
throw new CommonException(ErrorCode.SYSTEM_ERROR.getErrorCode(), "sorry,您无该页面的访问权限,请联系超级管理员!");
}
return true;
......
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