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
b1c04ef9
Commit
b1c04ef9
authored
Sep 25, 2019
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户路由权限
parent
234419be
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
AuthInterceptor.java
.../java/com/gic/enterprise/interceptor/AuthInterceptor.java
+6
-5
No files found.
gic-enterprise-common/src/main/java/com/gic/enterprise/interceptor/AuthInterceptor.java
View file @
b1c04ef9
...
...
@@ -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
;
...
...
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