update sa-token-core/src/main/java/cn/dev33/satoken/session/SaSession.java.

This commit is contained in:
省长
2021-02-14 00:44:55 +08:00
committed by Gitee
parent f1919769a4
commit 8ce9a70dbf

View File

@@ -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();
} }
/** /**