mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-06 07:21:24 +08:00
Added login, logout and getUserinfo (Include ui and server)
This commit is contained in:
@@ -55,4 +55,20 @@ public class ResponseResult implements Serializable {
|
||||
public static ResponseResult fail(String msg, Object data) {
|
||||
return build(ResponseCode.SYSTEM_ERROR, msg, data);
|
||||
}
|
||||
|
||||
public static ResponseResult databaseSelectSuccess(Object object) {
|
||||
return build(ResponseCode.DATABASE_SELECT_OK, "success", object);
|
||||
}
|
||||
|
||||
public static ResponseResult databaseSaveSuccess(Object object) {
|
||||
return build(ResponseCode.DATABASE_SAVE_OK, "success", object);
|
||||
}
|
||||
|
||||
public static ResponseResult databaseUpdateSuccess(Object object) {
|
||||
return build(ResponseCode.DATABASE_UPDATE_OK, "success", object);
|
||||
}
|
||||
|
||||
public static ResponseResult databaseDeleteSuccess() {
|
||||
return build(ResponseCode.DATABASE_DELETE_OK, "success", null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cfive.pinnacle.entity.permission;
|
||||
|
||||
import com.cfive.pinnacle.entity.User;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -14,102 +15,46 @@ import java.util.Collection;
|
||||
@AllArgsConstructor
|
||||
public class LoginUser implements UserDetails {
|
||||
private User user;
|
||||
private Collection<? extends GrantedAuthority> authorities;
|
||||
private String password;
|
||||
private String username;
|
||||
private Boolean accountNonExpired = true;
|
||||
private Boolean accountNonLocked = true;
|
||||
private Boolean credentialsNonExpired = true;
|
||||
private Boolean enabled = true;
|
||||
|
||||
public LoginUser(User user) {
|
||||
this.user = user;
|
||||
this.username = user.getUsername();
|
||||
this.password = user.getPasswd();
|
||||
this.enabled = user.getEnable() == 1;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@Override
|
||||
public Collection<? extends GrantedAuthority> getAuthorities() {
|
||||
return authorities;
|
||||
}
|
||||
|
||||
public void setAuthorities(Collection<? extends GrantedAuthority> authorities) {
|
||||
this.authorities = authorities;
|
||||
return null;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@Override
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
return user.getPasswd();
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@Override
|
||||
public String getUsername() {
|
||||
return username;
|
||||
return user.getUsername();
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@Override
|
||||
public boolean isAccountNonExpired() {
|
||||
return this.accountNonExpired;
|
||||
return true;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@Override
|
||||
public boolean isAccountNonLocked() {
|
||||
return this.accountNonLocked;
|
||||
return true;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@Override
|
||||
public boolean isCredentialsNonExpired() {
|
||||
return this.credentialsNonExpired;
|
||||
return true;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return this.enabled;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public Boolean getAccountNonExpired() {
|
||||
return accountNonExpired;
|
||||
}
|
||||
|
||||
public void setAccountNonExpired(Boolean accountNonExpired) {
|
||||
this.accountNonExpired = accountNonExpired;
|
||||
}
|
||||
|
||||
public Boolean getAccountNonLocked() {
|
||||
return accountNonLocked;
|
||||
}
|
||||
|
||||
public void setAccountNonLocked(Boolean accountNonLocked) {
|
||||
this.accountNonLocked = accountNonLocked;
|
||||
}
|
||||
|
||||
public Boolean getCredentialsNonExpired() {
|
||||
return credentialsNonExpired;
|
||||
}
|
||||
|
||||
public void setCredentialsNonExpired(Boolean credentialsNonExpired) {
|
||||
this.credentialsNonExpired = credentialsNonExpired;
|
||||
}
|
||||
|
||||
public Boolean getEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(Boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
return user.getEnable() == 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,12 +45,6 @@ public class Operation implements Serializable {
|
||||
@TableField("code")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* URL 前缀
|
||||
*/
|
||||
@TableField("url_prefix")
|
||||
private String urlPrefix;
|
||||
|
||||
/**
|
||||
* 权限ID
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.cfive.pinnacle.entity.permission;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
public class PowerSet implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private List<Operation> operationList;
|
||||
|
||||
private List<Menu> menuList;
|
||||
|
||||
private List<Element> elementList;
|
||||
|
||||
private List<File> fileList;
|
||||
}
|
||||
Reference in New Issue
Block a user