hjl
2024-06-06 81714ac84eb9cf515c0dbf701b5b87d02bafb6bd
ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/service/TokenService.java
@@ -220,17 +220,17 @@
            String userkey = JwtUtils.getUserKeyStudy(token);
            user = redisService.getCacheObject(getTokenKeyStudy(userkey));
            // 再次判断登录状态是否已过期
            if (null == user) {
                throw new StudyLoginException("登录信息已过期,请重新登录!", 504);
            }
            // 优先判断当前账号是否已在其他设备登录
            if (!user.getIsCanLogin()) {
                throw new StudyLoginException("当前登录账号在其他设备登录!", 505);
            }
            // 再次判断登录状态是否已过期
            if (System.currentTimeMillis() > user.getExpireTime()) {
                throw new StudyLoginException("登录信息已过期,请重新登录!", 504);
            }
//            if (null == user) {
//                throw new StudyLoginException("登录信息已过期,请重新登录!", 504);
//            }
//            // 优先判断当前账号是否已在其他设备登录
//            if (!user.getIsCanLogin()) {
//                throw new StudyLoginException("当前登录账号在其他设备登录!", 505);
//            }
//            // 再次判断登录状态是否已过期
//            if (System.currentTimeMillis() > user.getExpireTime()) {
//                throw new StudyLoginException("登录信息已过期,请重新登录!", 504);
//            }
            return user;
        }
        return user;