Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-enterprise-base
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
base_platform_enterprise
gic-enterprise-base
Commits
e9356514
Commit
e9356514
authored
Oct 09, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限过滤修改
parent
5689a61c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
AuthInterceptor.java
.../java/com/gic/enterprise/interceptor/AuthInterceptor.java
+12
-0
No files found.
gic-enterprise-common/src/main/java/com/gic/enterprise/interceptor/AuthInterceptor.java
View file @
e9356514
...
...
@@ -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,您无该页面的访问权限,请联系超级管理员!"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment