Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
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
fangxinjiang
yifu-mvp
Commits
c95f3128
Commit
c95f3128
authored
Nov 24, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
571c7e78
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
5 deletions
+1
-5
YifuUserDetailsServiceImpl.java
...u/common/security/service/YifuUserDetailsServiceImpl.java
+1
-5
No files found.
yifu-common/yifu-common-security/src/main/java/com/yifu/cloud/plus/v1/yifu/common/security/service/YifuUserDetailsServiceImpl.java
View file @
c95f3128
...
...
@@ -42,8 +42,6 @@ import org.springframework.security.core.userdetails.UserDetails;
@RequiredArgsConstructor
public
class
YifuUserDetailsServiceImpl
implements
YifuUserDetailsService
{
//private final RemoteUserService remoteUserService;
private
final
CacheManager
cacheManager
;
private
final
DaprUpmsProperties
daprUpmsProperties
;
...
...
@@ -57,13 +55,11 @@ public class YifuUserDetailsServiceImpl implements YifuUserDetailsService {
@SneakyThrows
public
UserDetails
loadUserByUsername
(
String
username
)
{
Cache
cache
=
cacheManager
.
getCache
(
CacheConstants
.
USER_DETAILS
);
Object
o
=
cache
.
get
(
username
);
if
(
cache
!=
null
&&
cache
.
get
(
username
)
!=
null
)
{
return
(
YifuUser
)
cache
.
get
(
username
).
get
();
}
R
<
UserInfo
>
result
;
// = remoteUserService.info(username, SecurityConstants.FROM_IN);
result
=
HttpDaprUtil
.
invokeMethodGet
(
daprUpmsProperties
.
getAppUrl
(),
daprUpmsProperties
.
getAppId
(),
"/user/getInfoByUsername"
,
"?username="
+
username
,
UserInfo
.
class
);
R
<
UserInfo
>
result
=
HttpDaprUtil
.
invokeMethodGet
(
daprUpmsProperties
.
getAppUrl
(),
daprUpmsProperties
.
getAppId
(),
"/user/getInfoByUsername"
,
"?username="
+
username
,
UserInfo
.
class
);
UserDetails
userDetails
=
getUserDetails
(
result
);
if
(
cache
!=
null
)
{
cache
.
put
(
username
,
userDetails
);
...
...
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