添加支持redis的String作为session序列化的方式

This commit is contained in:
sikadai
2022-07-18 18:39:25 +08:00
parent 1252d66267
commit 54d435b457
7 changed files with 353 additions and 48 deletions

View File

@@ -108,7 +108,14 @@ public class SaSession implements Serializable {
/**
* 此Session绑定的token签名列表
*/
private final List<TokenSign> tokenSignList = new Vector<>();
private Vector<TokenSign> tokenSignList = new Vector<>();
/**
* 设置此Session绑定的token签名列表-反序列化需要
*/
public void setTokenSignList(Vector<TokenSign> tokenSignList) {
this.tokenSignList = tokenSignList;
}
/**
* 此Session绑定的token签名列表
@@ -597,6 +604,4 @@ public class SaSession implements Serializable {
return dataMap.keySet();
}
}

View File

@@ -3,62 +3,77 @@ package cn.dev33.satoken.session;
import java.io.Serializable;
/**
* Token 签名 Model
*
* Token 签名 Model
* <p>
* 挂在到SaSession上的token签名
*
* @author kong
*
* @author kong
*/
public class TokenSign implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1406115065849845073L;
/**
*
*/
private static final long serialVersionUID = 1406115065849845073L;
/**
* token值
*/
private String value;
/**
* token值
*/
private String value;
/**
* 所属设备类型
*/
private String device;
/**
* 所属设备类型
*/
private String device;
/** 构建一个 */
public TokenSign() {
}
/**
* 构建一个
*/
public TokenSign() {
}
/**
* 构建一个
*
* @param value token值
* @param device 所属设备类型
*/
public TokenSign(String value, String device) {
this.value = value;
this.device = device;
}
/**
* 构建一个
*
* @param value token值
* @param device 所属设备类型
*/
public TokenSign(String value, String device) {
this.value = value;
this.device = device;
}
/**
* @return token值
*/
public String getValue() {
return value;
}
/**
* @return token值
*/
public String getValue() {
return value;
}
/**
* @return 所属设备类型
*/
public String getDevice() {
return device;
}
/**
* @return 所属设备类型
*/
public String getDevice() {
return device;
}
@Override
public String toString() {
return "TokenSign [value=" + value + ", device=" + device + "]";
}
/**
* 反序列化需要
*/
public void setValue(String value) {
this.value = value;
}
/**
* 反序列化需要
*/
public void setDevice(String device) {
this.device = device;
}
@Override
public String toString() {
return "TokenSign [value=" + value + ", device=" + device + "]";
}
}