fix: token 判空

This commit is contained in:
xiongxiaoyang 2022-05-19 21:01:38 +08:00
parent cd8c937584
commit ee449134d0

View File

@ -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;
@ -35,7 +36,7 @@ public interface AuthStrategy {
* @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);
}