Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加 StpUtil.getLoginInfo() 和 StpUtil.getLoginInfo(Object loginId) 来获取登录信息 #647

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions sa-token-core/src/main/java/cn/dev33/satoken/stp/SaLoginInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
package cn.dev33.satoken.stp;

/**
* 登录信息 model
*
*<P>
* {
* "tokenName": "satoekn", //request Header Name
* "tokenValue": "eef25f7b6c6048d093fc4427aa62f36c", //token
* "loginId": 10002, //login id
* "tokenTimeout": -1, //token 剩余有效期(单位: 秒)
* "sessionTimeout": -1, //Session 剩余有效时间(单位: 秒)
* "tokenSessionTimeout": -1, //Token-Session 剩余有效时间(单位: 秒)
* "tokenActiveTimeout": -1, //token 距离被冻结还剩多少时间(单位: 秒)
* "loginDevice": "Android-Readmi K50" //登录设备
* }
*</P>
*
* @author suzhelan
* @version 1.0
*/
public class SaLoginInfo {
/**
* token name
*/
private String tokenName;

/**
* token
*/
private String tokenValue;

/**
* 此 token 对应的 LoginId
*/
private Object loginId;

/**
* token 剩余有效期(单位: 秒)
*/
private long tokenTimeout;

/**
* Account-Session 剩余有效时间(单位: 秒)
*/
private long sessionTimeout;

/**
* Token-Session 剩余有效时间(单位: 秒)
*/
private long tokenSessionTimeout;

/**
* token 距离被冻结还剩多少时间(单位: 秒)
*/
private long tokenActiveTimeout;

/**
* 登录设备类型
*/
private String loginDevice;

public String getTokenName() {
return tokenName;
}

public void setTokenName(String tokenName) {
this.tokenName = tokenName;
}

public String getTokenValue() {
return tokenValue;
}

public void setTokenValue(String tokenValue) {
this.tokenValue = tokenValue;
}

public Object getLoginId() {
return loginId;
}

public void setLoginId(Object loginId) {
this.loginId = loginId;
}

public long getTokenTimeout() {
return tokenTimeout;
}

public void setTokenTimeout(long tokenTimeout) {
this.tokenTimeout = tokenTimeout;
}

public long getSessionTimeout() {
return sessionTimeout;
}

public void setSessionTimeout(long sessionTimeout) {
this.sessionTimeout = sessionTimeout;
}

public long getTokenSessionTimeout() {
return tokenSessionTimeout;
}

public void setTokenSessionTimeout(long tokenSessionTimeout) {
this.tokenSessionTimeout = tokenSessionTimeout;
}

public long getTokenActiveTimeout() {
return tokenActiveTimeout;
}

public void setTokenActiveTimeout(long tokenActiveTimeout) {
this.tokenActiveTimeout = tokenActiveTimeout;
}

public String getLoginDevice() {
return loginDevice;
}

public void setLoginDevice(String loginDevice) {
this.loginDevice = loginDevice;
}
}
Loading