mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-12-21 19:09:45 +08:00
v1.27.1 beta. 细节优化
This commit is contained in:
@@ -93,7 +93,7 @@ public class SaLoginModel {
|
||||
/**
|
||||
* @return 获取device参数,如果为null,则返回默认值
|
||||
*/
|
||||
public String getDeviceOrDefalut() {
|
||||
public String getDeviceOrDefault() {
|
||||
if(device == null) {
|
||||
return SaTokenConsts.DEFAULT_LOGIN_DEVICE;
|
||||
}
|
||||
@@ -142,4 +142,13 @@ public class SaLoginModel {
|
||||
return "SaLoginModel [device=" + device + ", isLastingCookie=" + isLastingCookie + ", timeout=" + timeout + "]";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 更换为 getDeviceOrDefault()
|
||||
* @return /
|
||||
*/
|
||||
@Deprecated
|
||||
public String getDeviceOrDefalut() {
|
||||
return getDeviceOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,7 +256,7 @@ public class StpLogic {
|
||||
if(config.getIsConcurrent()) {
|
||||
// 如果配置为共享token, 则尝试从Session签名记录里取出token
|
||||
if(config.getIsShare()) {
|
||||
tokenValue = getTokenValueByLoginId(id, loginModel.getDevice());
|
||||
tokenValue = getTokenValueByLoginId(id, loginModel.getDeviceOrDefault());
|
||||
}
|
||||
} else {
|
||||
// --- 如果不允许并发登录,则将这个账号的历史登录标记为:被顶下线
|
||||
@@ -272,7 +272,7 @@ public class StpLogic {
|
||||
session.updateMinTimeout(loginModel.getTimeout());
|
||||
|
||||
// 在 User-Session 上记录token签名
|
||||
session.addTokenSign(tokenValue, loginModel.getDeviceOrDefalut());
|
||||
session.addTokenSign(tokenValue, loginModel.getDeviceOrDefault());
|
||||
|
||||
// ------ 4. 持久化其它数据
|
||||
// token -> id 映射关系
|
||||
|
||||
Reference in New Issue
Block a user