diff --git a/sa-token-core/src/main/java/cn/dev33/satoken/stp/StpLogic.java b/sa-token-core/src/main/java/cn/dev33/satoken/stp/StpLogic.java index 80c69e6a..33ebe5b2 100644 --- a/sa-token-core/src/main/java/cn/dev33/satoken/stp/StpLogic.java +++ b/sa-token-core/src/main/java/cn/dev33/satoken/stp/StpLogic.java @@ -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(); diff --git a/sa-token-demo-jwt/src/main/java/com/pj/satoken/jwt/SaTokenJwtUtil.java b/sa-token-demo-jwt/src/main/java/com/pj/satoken/jwt/SaTokenJwtUtil.java index 7677824f..8bf0161b 100644 --- a/sa-token-demo-jwt/src/main/java/com/pj/satoken/jwt/SaTokenJwtUtil.java +++ b/sa-token-demo-jwt/src/main/java/com/pj/satoken/jwt/SaTokenJwtUtil.java @@ -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 { }; - }