mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-09-20 02:29:27 +08:00
update sa-token-core/src/main/java/cn/dev33/satoken/session/SaSession.java.
This commit is contained in:
@@ -119,18 +119,16 @@ public class SaSession implements Serializable {
|
||||
* @param tokenSign token签名
|
||||
*/
|
||||
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())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// 添加并更新
|
||||
tokenSignList.add(tokenSign);
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除一个token签名
|
||||
|
Reference in New Issue
Block a user