diff --git a/src/main/java/io/github/xxyopen/novel/core/auth/AuthStrategy.java b/src/main/java/io/github/xxyopen/novel/core/auth/AuthStrategy.java index 84a5fa4..4a03405 100644 --- a/src/main/java/io/github/xxyopen/novel/core/auth/AuthStrategy.java +++ b/src/main/java/io/github/xxyopen/novel/core/auth/AuthStrategy.java @@ -6,6 +6,7 @@ import io.github.xxyopen.novel.core.constant.SystemConfigConsts; import io.github.xxyopen.novel.core.util.JwtUtils; import io.github.xxyopen.novel.dto.UserInfoDto; import io.github.xxyopen.novel.manager.UserInfoCacheManager; +import org.springframework.util.StringUtils; import java.util.Objects; @@ -29,13 +30,13 @@ public interface AuthStrategy { /** * 前台多系统单点登录统一账号认证(门户系统、作家系统以及后面会扩展的漫画系统和视频系统等) * - * @param jwtUtils jwt 工具 + * @param jwtUtils jwt 工具 * @param userInfoCacheManager 用户缓存管理对象 - * @param token token 登录 token + * @param token token 登录 token * @return 用户ID */ default Long authSSO(JwtUtils jwtUtils, UserInfoCacheManager userInfoCacheManager, String token) { - if (Objects.isNull(token)) { + if (!StringUtils.hasText(token)) { // token 为空 throw new BusinessException(ErrorCodeEnum.USER_LOGIN_EXPIRED); }