Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
27ba3274
Commit
27ba3274
authored
Aug 27, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
屏蔽部分配置
parent
93b71ceb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
ServiceAuthRestInterceptor.java
...y/auth/client/interceptor/ServiceAuthRestInterceptor.java
+4
-4
UserAuthRestInterceptor.java
...rity/auth/client/interceptor/UserAuthRestInterceptor.java
+4
-4
No files found.
ace-auth/ace-auth-client/src/main/java/com/github/wxiaoqi/security/auth/client/interceptor/ServiceAuthRestInterceptor.java
View file @
27ba3274
...
@@ -32,7 +32,7 @@ public class ServiceAuthRestInterceptor extends HandlerInterceptorAdapter {
...
@@ -32,7 +32,7 @@ public class ServiceAuthRestInterceptor extends HandlerInterceptorAdapter {
@Override
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
if
(
handler
instanceof
HandlerMethod
)
{
//
if (handler instanceof HandlerMethod) {
HandlerMethod
handlerMethod
=
(
HandlerMethod
)
handler
;
HandlerMethod
handlerMethod
=
(
HandlerMethod
)
handler
;
// 配置该注解,说明不进行服务拦截
// 配置该注解,说明不进行服务拦截
IgnoreClientToken
annotation
=
handlerMethod
.
getBeanType
().
getAnnotation
(
IgnoreClientToken
.
class
);
IgnoreClientToken
annotation
=
handlerMethod
.
getBeanType
().
getAnnotation
(
IgnoreClientToken
.
class
);
...
@@ -52,8 +52,8 @@ public class ServiceAuthRestInterceptor extends HandlerInterceptorAdapter {
...
@@ -52,8 +52,8 @@ public class ServiceAuthRestInterceptor extends HandlerInterceptorAdapter {
}
}
}
}
throw
new
ClientForbiddenException
(
"Client is Forbidden!"
);
throw
new
ClientForbiddenException
(
"Client is Forbidden!"
);
}
else
{
//
} else {
return
super
.
preHandle
(
request
,
response
,
handler
);
//
return super.preHandle(request, response, handler);
}
//
}
}
}
}
}
ace-auth/ace-auth-client/src/main/java/com/github/wxiaoqi/security/auth/client/interceptor/UserAuthRestInterceptor.java
View file @
27ba3274
...
@@ -31,7 +31,7 @@ public class UserAuthRestInterceptor extends HandlerInterceptorAdapter {
...
@@ -31,7 +31,7 @@ public class UserAuthRestInterceptor extends HandlerInterceptorAdapter {
@Override
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
throws
Exception
{
if
(
handler
instanceof
HandlerMethod
)
{
//
if (handler instanceof HandlerMethod) {
HandlerMethod
handlerMethod
=
(
HandlerMethod
)
handler
;
HandlerMethod
handlerMethod
=
(
HandlerMethod
)
handler
;
// 配置该注解,说明不进行用户拦截
// 配置该注解,说明不进行用户拦截
IgnoreUserToken
annotation
=
handlerMethod
.
getBeanType
().
getAnnotation
(
IgnoreUserToken
.
class
);
IgnoreUserToken
annotation
=
handlerMethod
.
getBeanType
().
getAnnotation
(
IgnoreUserToken
.
class
);
...
@@ -64,9 +64,9 @@ public class UserAuthRestInterceptor extends HandlerInterceptorAdapter {
...
@@ -64,9 +64,9 @@ public class UserAuthRestInterceptor extends HandlerInterceptorAdapter {
BaseContextHandler
.
setToken
(
token
);
BaseContextHandler
.
setToken
(
token
);
// 这里可以添加RequestType
// 这里可以添加RequestType
return
super
.
preHandle
(
request
,
response
,
handler
);
return
super
.
preHandle
(
request
,
response
,
handler
);
}
else
{
//
}else {
return
super
.
preHandle
(
request
,
response
,
handler
);
//
return super.preHandle(request, response, handler);
}
//
}
}
}
@Override
@Override
...
...
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