mirror of
https://gitee.com/dromara/sa-token.git
synced 2024-12-03 12:27:50 +08:00
取消判断同账号免重复登陆
This commit is contained in:
parent
713758c304
commit
ac4ac37175
@ -145,14 +145,6 @@ public class StpLogic {
|
||||
*/
|
||||
public void setLoginId(Object loginId, String device) {
|
||||
|
||||
// ------ 0、如果当前会话已经登录上了此LoginId,且登录设备相同,则立即返回
|
||||
Object loggedId = getLoginIdDefaultNull();
|
||||
if(loggedId != null && loggedId.toString().equals(loginId.toString())) {
|
||||
String loggedDevice = getLoginDevice();
|
||||
if(loggedDevice != null && loggedDevice.equals(device)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// ------ 1、获取相应对象
|
||||
HttpServletRequest request = SaTokenManager.getSaTokenServlet().getRequest();
|
||||
|
@ -27,7 +27,7 @@ import io.jsonwebtoken.SignatureAlgorithm;
|
||||
public class SaTokenJwtUtil {
|
||||
|
||||
/**
|
||||
* 秘钥
|
||||
* 秘钥 (随便手打几个字母就好了)
|
||||
*/
|
||||
public static final String BASE64_SECURITY = "79e7c69681b8270162386e6daa53d1dd";
|
||||
|
||||
@ -102,6 +102,14 @@ public class SaTokenJwtUtil {
|
||||
|
||||
|
||||
static {
|
||||
|
||||
// 判断秘钥
|
||||
if(BASE64_SECURITY.equals("79e7c69681b8270162386e6daa53d1dd")) {
|
||||
String warn = "-------------------------------------\n";
|
||||
warn += "请更换JWT秘钥,不要使用示例默认秘钥\n";
|
||||
warn += "-------------------------------------";
|
||||
System.err.println(warn);
|
||||
}
|
||||
|
||||
// 修改默认实现
|
||||
StpUtil.stpLogic = new StpLogic("login") {
|
||||
@ -207,7 +215,6 @@ public class SaTokenJwtUtil {
|
||||
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user