|
@@ -2,15 +2,15 @@ package com.welampiot.dto;
|
|
|
|
|
|
import lombok.Data;
|
|
|
import org.springframework.security.core.GrantedAuthority;
|
|
|
-import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
|
|
import org.springframework.security.core.userdetails.UserDetails;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
import java.util.Collection;
|
|
|
import java.util.List;
|
|
|
|
|
|
+@Component
|
|
|
@Data
|
|
|
public class UserDTO implements UserDetails, Serializable {
|
|
|
private Integer id;
|
|
@@ -46,12 +46,12 @@ public class UserDTO implements UserDetails, Serializable {
|
|
|
@Override
|
|
|
public Collection<? extends GrantedAuthority> getAuthorities() {
|
|
|
List<GrantedAuthority> grantedAuthorities = new ArrayList<>();
|
|
|
- List<String> list = Arrays.asList(getPrivilegeList().split(","));
|
|
|
- // 声明用户授权
|
|
|
- list.forEach(sysPermission -> {
|
|
|
- GrantedAuthority grantedAuthority = new SimpleGrantedAuthority(sysPermission);
|
|
|
- grantedAuthorities.add(grantedAuthority);
|
|
|
- });
|
|
|
+// List<String> list = Arrays.asList(getPrivilegeList().split(","));
|
|
|
+// // 声明用户授权
|
|
|
+// list.forEach(sysPermission -> {
|
|
|
+// GrantedAuthority grantedAuthority = new SimpleGrantedAuthority(sysPermission);
|
|
|
+// grantedAuthorities.add(grantedAuthority);
|
|
|
+// });
|
|
|
return grantedAuthorities;
|
|
|
}
|
|
|
|