Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gdtel-gztel-school-center
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴学德
gdtel-gztel-school-center
Commits
556ce5c3
Commit
556ce5c3
authored
Mar 15, 2022
by
罗承锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化垂直鉴权
parent
15496373
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
11 deletions
+8
-11
core-service/src/main/java/com/winsun/intercept/AuthIntercept.java
+4
-6
service-manager/src/main/java/com/winsun/intercept/AuthIntercept.java
+4
-5
No files found.
core-service/src/main/java/com/winsun/intercept/AuthIntercept.java
View file @
556ce5c3
...
...
@@ -65,10 +65,11 @@ public class AuthIntercept extends HandlerInterceptorAdapter {
String
key
=
AUTH_REDIS_PREFIX
+
StringUtils
.
join
(
roleList
.
toArray
(),
","
);
String
securityKey
=
AUTH_REDIS_SECURITY
+
security
;
String
securityValue
=
stringRedisTemplate
.
opsForValue
().
get
(
securityKey
);
if
(
StringUtils
.
isNotBlank
(
securityValue
))
{
Boolean
aBoolean
=
stringRedisTemplate
.
opsForValue
().
setIfAbsent
(
securityKey
,
"1"
);
if
(!
aBoolean
)
{
return
false
;
}
else
{
stringRedisTemplate
.
opsForValue
().
set
(
securityKey
,
"1"
,
1
,
TimeUnit
.
DAYS
);
}
ResponseData
<
String
>
stringResponseData
=
LoginUtils
.
pwdDecrypt
(
security
);
...
...
@@ -102,9 +103,6 @@ public class AuthIntercept extends HandlerInterceptorAdapter {
log
.
info
(
menu
.
getUrl
());
if
(
StringUtils
.
equals
(
menu
.
getUrl
(),
data
))
{
log
.
info
(
"获取到相同的菜单"
);
stringRedisTemplate
.
opsForValue
().
set
(
securityKey
,
"1"
,
1
,
TimeUnit
.
HOURS
);
return
true
;
}
}
...
...
service-manager/src/main/java/com/winsun/intercept/AuthIntercept.java
View file @
556ce5c3
...
...
@@ -72,9 +72,11 @@ public class AuthIntercept extends HandlerInterceptorAdapter {
String
securityKey
=
AUTH_REDIS_SECURITY
+
security
;
String
securityValue
=
stringRedisTemplate
.
opsForValue
().
get
(
securityKey
);
if
(
StringUtils
.
isNotBlank
(
securityValue
)
)
{
Boolean
aBoolean
=
stringRedisTemplate
.
opsForValue
().
setIfAbsent
(
securityKey
,
"1"
);
if
(
!
aBoolean
)
{
return
false
;
}
else
{
stringRedisTemplate
.
opsForValue
().
set
(
securityKey
,
"1"
,
1
,
TimeUnit
.
DAYS
);
}
ResponseData
<
String
>
stringResponseData
=
LoginUtils
.
pwdDecrypt
(
security
);
...
...
@@ -108,9 +110,6 @@ public class AuthIntercept extends HandlerInterceptorAdapter {
log
.
info
(
menu
.
getUrl
());
if
(
StringUtils
.
equals
(
menu
.
getUrl
(),
data
))
{
log
.
info
(
"获取到相同的菜单"
);
stringRedisTemplate
.
opsForValue
().
set
(
securityKey
,
"1"
,
1
,
TimeUnit
.
HOURS
);
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