|
@@ -6,7 +6,6 @@ import com.miaxis.common.core.domain.entity.SysUser;
|
|
|
import com.miaxis.common.core.domain.entity.UserInfo;
|
|
|
import io.swagger.annotations.ApiModel;
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
-import lombok.Data;
|
|
|
import org.springframework.security.core.GrantedAuthority;
|
|
|
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
|
|
import org.springframework.security.core.userdetails.UserDetails;
|
|
@@ -22,7 +21,6 @@ import java.util.Set;
|
|
|
* @author miaxis
|
|
|
*/
|
|
|
@ApiModel(value = "LoginUser", description = "登录用户身份权限")
|
|
|
-@Data
|
|
|
public class LoginUser implements UserDetails
|
|
|
{
|
|
|
private static final long serialVersionUID = 1L;
|
|
@@ -256,13 +254,21 @@ public class LoginUser implements UserDetails
|
|
|
|
|
|
public void setUser(SysUser user)
|
|
|
{
|
|
|
- this.user = user;
|
|
|
+ this.student = student;
|
|
|
+ }
|
|
|
+ public UserInfo getStudent()
|
|
|
+ {
|
|
|
+ return this.student;
|
|
|
}
|
|
|
|
|
|
+ public void setStudent(UserInfo student)
|
|
|
+ {
|
|
|
+ this.student = student;
|
|
|
+ }
|
|
|
@Override
|
|
|
public Collection<? extends GrantedAuthority> getAuthorities()
|
|
|
{
|
|
|
- if (getStudent() != null){
|
|
|
+ if (this.getStudent() != null){
|
|
|
List<SimpleGrantedAuthority> roleList = new ArrayList<SimpleGrantedAuthority>();
|
|
|
roleList.add(new SimpleGrantedAuthority("ROLE_STUDENT"));
|
|
|
return roleList;
|
|
@@ -272,4 +278,8 @@ public class LoginUser implements UserDetails
|
|
|
|
|
|
|
|
|
}
|
|
|
+ public void setAuthorities(Collection<? extends GrantedAuthority> collection){
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|