Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
brandkbs2
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
shenjunjie
brandkbs2
Commits
58e2301c
Commit
58e2301c
authored
Mar 29, 2023
by
shenjunjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权限部分调整4
parent
341f1d71
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
13 deletions
+0
-13
src/main/java/com/zhiwei/brandkbs2/auth/AuthAspect.java
+0
-13
No files found.
src/main/java/com/zhiwei/brandkbs2/auth/AuthAspect.java
View file @
58e2301c
...
@@ -2,7 +2,6 @@ package com.zhiwei.brandkbs2.auth;
...
@@ -2,7 +2,6 @@ package com.zhiwei.brandkbs2.auth;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.zhiwei.brandkbs2.common.GenericAttribute
;
import
com.zhiwei.brandkbs2.common.GenericAttribute
;
import
com.zhiwei.brandkbs2.enmus.RoleEnum
;
import
com.zhiwei.brandkbs2.model.CommonCodeEnum
;
import
com.zhiwei.brandkbs2.model.CommonCodeEnum
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.model.ResponseResult
;
import
com.zhiwei.brandkbs2.pojo.UserInfo
;
import
com.zhiwei.brandkbs2.pojo.UserInfo
;
...
@@ -56,18 +55,6 @@ public class AuthAspect {
...
@@ -56,18 +55,6 @@ public class AuthAspect {
public
Object
around
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
public
Object
around
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
ServletRequestAttributes
servletRequestAttributes
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
());
ServletRequestAttributes
servletRequestAttributes
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
());
HttpServletRequest
request
=
servletRequestAttributes
.
getRequest
();
HttpServletRequest
request
=
servletRequestAttributes
.
getRequest
();
Signature
signature
=
joinPoint
.
getSignature
();
Method
method
=
((
MethodSignature
)
signature
).
getMethod
();
Class
<?>
classTarget
=
joinPoint
.
getTarget
().
getClass
();
// 优先使用方法权限
Auth
auth
=
method
.
getAnnotation
(
Auth
.
class
);
if
(
null
==
auth
)
{
auth
=
classTarget
.
getAnnotation
(
Auth
.
class
);
}
// 不需要验证权限
if
(
null
==
auth
||
RoleEnum
.
NO_AUTHORISE
==
auth
.
role
())
{
return
joinPoint
.
proceed
();
}
String
token
=
request
.
getHeader
(
jwtKey
);
String
token
=
request
.
getHeader
(
jwtKey
);
// 存在有效token
// 存在有效token
if
(
null
!=
token
&&
!
Tools
.
tokenEmpty
(
token
))
{
if
(
null
!=
token
&&
!
Tools
.
tokenEmpty
(
token
))
{
...
...
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