2022-09-30 09:41:48 +08:00
|
|
|
package com.rzyc.config;
|
|
|
|
|
|
|
|
|
|
import org.springframework.security.core.GrantedAuthority;
|
|
|
|
|
import org.springframework.security.core.userdetails.User;
|
|
|
|
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* spring security UserDetails Custom Part
|
|
|
|
|
* @author Xuwanxin
|
|
|
|
|
* @date 2022/9/28
|
|
|
|
|
* */
|
|
|
|
|
|
2022-10-10 16:22:53 +08:00
|
|
|
public class UserDetailsAndId extends User {
|
2022-09-30 09:41:48 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
private String id;
|
|
|
|
|
|
|
|
|
|
public String getId() {
|
|
|
|
|
return id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setId(String id) {
|
|
|
|
|
this.id = id;
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-10 16:22:53 +08:00
|
|
|
public UserDetailsAndId(String username, String password, Collection<? extends GrantedAuthority> authorities, String id) {
|
2022-09-30 09:41:48 +08:00
|
|
|
super(username, password, authorities);
|
|
|
|
|
setId(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|