Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
springBoot
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
WitCloud
springBoot
Commits
e14bc1cc
Commit
e14bc1cc
authored
Jan 20, 2017
by
杨伊博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ok
parent
819ab9e3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
19 deletions
+0
-19
CustomUserService.java
...c/main/java/com/us/example/service/CustomUserService.java
+0
-19
No files found.
springboot-security/src/main/java/com/us/example/service/CustomUserService.java
View file @
e14bc1cc
...
...
@@ -28,25 +28,6 @@ public class CustomUserService implements UserDetailsService { //自定义UserDe
@Autowired
PermissionDao
permissionDao
;
// @Override
// public UserDetails loadUserByUsername(String username) { //重写loadUserByUsername 方法获得 userdetails 类型用户
//
// SysUser user = userDao.findByUserName(username);
// if(user == null){
// throw new UsernameNotFoundException("用户名不存在");
// }
// List<SimpleGrantedAuthority> authorities = new ArrayList<>();
// //用于添加用户的权限。只要把用户权限添加到authorities 就万事大吉。
// for(SysRole role:user.getRoles())
// {
// authorities.add(new SimpleGrantedAuthority(role.getName()));
// System.out.println(role.getName());
// }
// return new org.springframework.security.core.userdetails.User(user.getUsername(),
// user.getPassword(), authorities);
//
// }
public
UserDetails
loadUserByUsername
(
String
username
)
{
SysUser
user
=
userDao
.
findByUserName
(
username
);
if
(
user
!=
null
)
{
...
...
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