mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-09-20 18:47:58 +08:00
update sa-token-core/src/main/java/cn/dev33/satoken/session/SaSession.java.
This commit is contained in:
@@ -119,17 +119,15 @@ public class SaSession implements Serializable {
|
|||||||
* @param tokenSign token签名
|
* @param tokenSign token签名
|
||||||
*/
|
*/
|
||||||
public void addTokenSign(TokenSign tokenSign) {
|
public void addTokenSign(TokenSign tokenSign) {
|
||||||
// 判断是否存在列表
|
|
||||||
boolean tokenExits = this.getTokenSignList()
|
|
||||||
.stream()
|
|
||||||
.map(TokenSign::getValue)
|
|
||||||
.anyMatch(it -> it.equals(tokenSign.getValue()));
|
|
||||||
// 如果已经存在于列表中,则无需再次添加
|
// 如果已经存在于列表中,则无需再次添加
|
||||||
if (tokenExits == false) {
|
for (TokenSign tokenSign2 : getTokenSignList()) {
|
||||||
// 添加并更新
|
if (tokenSign2.getValue().equals(tokenSign.getValue())) {
|
||||||
tokenSignList.add(tokenSign);
|
return;
|
||||||
update();
|
}
|
||||||
}
|
}
|
||||||
|
// 添加并更新
|
||||||
|
tokenSignList.add(tokenSign);
|
||||||
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user